Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eulereadgbe/bcfd1a579e2b04d70c604c21deb91ffe to your computer and use it in GitHub Desktop.
Save eulereadgbe/bcfd1a579e2b04d70c604c21deb91ffe 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