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.