Repo on Github that I want to contribute to:

My fork of that repo on github:

Over time the upstream repo is updated but my fork on github does not automatically get those updates. To push the latest changes from to follows these steps.

Clone our repository:

git clone
cd whatever

Add the upstream repo as a remote, and call it upstream:

git remote add upstream

Get all the branches of the upstream repo into remote-tracking branches. These branches will be named upstream/master, upstream/some-feature, etc.

git fetch upstream

Now replay all of the upstream’s commits from the master branch against ours:

git checkout master
git rebase upstream/master
git push