Created
January 31, 2014 18:52
-
-
Save thomascrenshaw/8740531 to your computer and use it in GitHub Desktop.
Useful Git commands with references
This file contains hidden or 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
##--------------------------- | |
## 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