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 upstream
Checkout the branch you want to sync the upstream into (Usually master
).
git checkout master
Start rewriting your forked changes on top of the latest upstream/master
.
git rebase upstream/master -i
During the rebase it is now possible to adapt changes to the new upstream/master
.