Keeping Your GitHub Fork Up-To-Date

This is a quick tip: after forking a repository on GitHub sadly there is no button to easily fetch new commits from the original repository. So we have to do it manually. Luckily this is easy enough:

1. Add the original repository as a remote to your local clone:

$ git remote add openlink git://github.com/openlink/virtuoso-opensource.git

2. Now you can simply pull the changes from the original:

$ git checkout develop/6
$ git pull openlink develop/6

However, make sure you do not do a rebase pull with the pull as that would destroy any merges you did on your own fork.

3. Finally push them to your own fork:

$ git push origin develop/6

I am sure that for most git users this is trivial. I just wanted to clearly state that there is no difference when using GitHub. It does not provide us with any magic when it comes to fork updates.

Advertisements