Skip to content

Instantly share code, notes, and snippets.

@thomascrenshaw
Created January 31, 2014 18:52
Show Gist options
  • Save thomascrenshaw/8740531 to your computer and use it in GitHub Desktop.
Save thomascrenshaw/8740531 to your computer and use it in GitHub Desktop.
Useful Git commands with references
##---------------------------
## Keep local branch up-to-date with remote
# Add the upstream remote if have not already done so
git remote add upstream REMOTE_PROJECT_URL_git
# Fetch changes in REMOTE_PROJECT_URL_git
git fetch upstream
# Bring master of your locl fork-clone up-to-date
git checkout master && git merge upstream/master
# Rebase the LOCAL_BRANCH works if no uncommited changes
git rebase upstream/master
# -OR- to update branch on local fork
git checkout LOCAL_BRANCH && git merge upstream/master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment