Skip to content

Instantly share code, notes, and snippets.

@sergixnet
Created February 3, 2019 17:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergixnet/1e5bcb7ccb98cb28dc9b2602b48ffbb8 to your computer and use it in GitHub Desktop.
Save sergixnet/1e5bcb7ccb98cb28dc9b2602b48ffbb8 to your computer and use it in GitHub Desktop.
Git: Keep upstream in sync
# 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