I was reading on: https://wiki.diasporafoundation.org/Git_workflow#Rebase_your_development_branch_on_the_latest_upstream
Here is an extract:
Your Repository Up to Date
In order to get the latest updates from the development trunk do a one-time setup to establish the main GitHub repo as a remote by entering:
$ git remote add upstream git://github.com/diaspora/diaspora.git
Rebase Your Development Branch on the Latest Upstream
To keep your development branch up to date, rebase your changes on top of the current state of the upstream master. See the What’s git-rebase? section below to learn more about rebasing.
If you’ve set up an upstream branch as detailed above, and a development branch called 100-retweet-bugfix, you’d update upstream, update your local master, and rebase your branch from it like so:
$ git fetch upstream $ git checkout master $ git rebase upstream/master $ git checkout 100-retweet-bugfix
[make sure all is committed as necessary in branch]
$ git rebase master
Why is adding a 'remote upstream' needed in this case? Coudn't I have just done:
$ git checkout master
$ git pull origin master
$ git checkout 100-retweet-bugfix
[make sure all is committed as necessary in branch]
$ git rebase master