Created
January 22, 2019 03:03
-
-
Save pm-hwks/a380c38097c45cd30cc7d7d5b50c0296 to your computer and use it in GitHub Desktop.
[Git syncing a fork] How to sync a forked repo #git #github
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Reference | |
# https://help.github.com/articles/syncing-a-fork/ | |
git remote -v | |
# Add original git remote repo | |
git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git | |
git remote -v | |
# Fetch the branches and their respective commits from the upstream repository. Commits to master will be stored in a local branch, upstream/master. | |
git fetch upstream | |
# Check out your fork's local master branch. | |
git checkout master | |
#Merge the changes from upstream/master into your local master branch. This brings your fork's master branch into sync with the upstream repository, without losing your local changes. | |
git merge upstream/master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment