Skip to content

Instantly share code, notes, and snippets.

@spencermountain
Last active March 1, 2019 15:57
Show Gist options
  • Save spencermountain/5c3852a695cba86d8a6aabf55aff8b82 to your computer and use it in GitHub Desktop.
Save spencermountain/5c3852a695cba86d8a6aabf55aff8b82 to your computer and use it in GitHub Desktop.
Keeping a fork up-to-date
#add this function to ~/.bashrc or ~/.bash_profile
# each time you clone a fork, add the original as 'upstream'
# git remote add upstream git://github.com/REPO_ORG/REPO_NAME.git
# (thanks https://gist.github.com/CristinaSolana/1885435)
# keeps a fork up-to-date from the main repo
function update-fork() {
git fetch upstream
git pull upstream master
git push
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment