Sync a fork of a repository to keep it up-to-date with the upstream repository.
Inspired by the GitHub documentation
Fetch latest changes of the upstream repository.
git fetch upstreamCheckout the branch you want to sync the upstream into (Usually master).
git checkout masterStart rewriting your forked changes on top of the latest upstream/master.
git rebase upstream/master -iDuring the rebase it is now possible to adapt changes to the new upstream/master.