Skip to content

Instantly share code, notes, and snippets.

@jpalmieri
Created June 29, 2018 17:21
Show Gist options
  • Save jpalmieri/1e9733a18f23fb934b2d792f59597f0a to your computer and use it in GitHub Desktop.
Save jpalmieri/1e9733a18f23fb934b2d792f59597f0a to your computer and use it in GitHub Desktop.
have fork track master repo upstream changes
# https://www.gun.io/blog/how-to-github-fork-branch-and-pull-request
# (run on local repo after forking)
# This step isn't absolutely necessary, but I find it very useful if you plan on working on this project for anything more than a very quick fix. Use the following commands to add the 'upsteam' (original project location) as a remote branch so that you can get their updates into your branch. Replace the 'upstreamname' and 'projectname' values with that actual user/project name that you're trying to track.
git remote add --track master upstream git://github.com/upstreamname/projectname.git
# This will add the original project as a remote named 'upstream'. To get the code, type:
git fetch upstream
# Then, to merge it into your own project, type:
git merge upstream/master
# Tada! Now you'll have an up-to-date version of the upstream code in your current branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment