Created
February 3, 2019 17:28
-
-
Save sergixnet/1e5bcb7ccb98cb28dc9b2602b48ffbb8 to your computer and use it in GitHub Desktop.
Git: Keep upstream in sync
This file contains 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
# Add a remote repository | |
git remote add upstream <remote repository> | |
# Fetch all the refs (branches and/or tags) from the upstream | |
git fetch upstream | |
# Track upstream master with the local master | |
git branch --set-upstream-to=upstream/master master | |
# To keep our local master in sync now simple pull from upstream | |
git pull upstream master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment