Useful Commands
If a lot of changes has happened upstream you can replay your local changes on top of these, this is done with rebase, e.g.:
git fetch upstream
git rebase upstream/master
This will fetch changes and re-apply your commits on top of these.
This is generally better than merge, as it will give a clear picture of which commits are local to your branch. It will also “prune” any of your local commits if the same changes have been applied upstream.
You can use -i with rebase for an “interactive” rebase. This allows you to drop, re-arrange, merge, and reword commits, e.g.:
git rebase -i upstream/master