Skip to content

Instantly share code, notes, and snippets.

@christiearcus
Last active March 10, 2017 00:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiearcus/df580dd0bbbf6a6d8eeeb27cc7b51c56 to your computer and use it in GitHub Desktop.
Save christiearcus/df580dd0bbbf6a6d8eeeb27cc7b51c56 to your computer and use it in GitHub Desktop.
Pulling the latest changes from 'upstream'

When we refer to 'upstream' in our project, we are referring to the central version (and not our personal forks). By default, when you clone your fork, there will be no reference to the upstream version. But it's necessary to add this, as this allows us to pull the latest changes when pull requests are merged.

To set this up use the following steps:

  • Check your remote versions on your project:

git remote -v- if you want to look at it in your project code, you can check the config file of the .git folder.

  • Add the reference to the upstream repository:

git remote add upstream [project-url-here]

  • Check again to make sure it worked

git remote -v - you should now see upstream there.

  • Pull down the latest changes from upstream

git pull -r upstream master -r - this is a 'rebase' flag. i wouldn't worry too much about it, but it means if you have any local changes it'll apply them to the top. upstream where you want to pull from master which branch you want to pull from. we only really have a master branch so it shouldn't change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment