Skip to content

Instantly share code, notes, and snippets.

@hardyoyo
Last active July 5, 2017 02:04
Show Gist options
  • Save hardyoyo/8738b9fcad5f2a682796baf375393326 to your computer and use it in GitHub Desktop.
Save hardyoyo/8738b9fcad5f2a682796baf375393326 to your computer and use it in GitHub Desktop.
How to keep a git branch up to date with an upstream master branch.
git fetch --all
git checkout master #may have to git stash first, but, don't forget, you need to be ON THE MASTER BRANCH before you proceed
git pull upstream master
git push origin master
git pull origin master #not necessary but a nice sanity check
git checkout BRANCHNAME
git rebase -i master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment