There are several reasons to do a rebase of your feature branch (for a pull request etc.) against master.
- The master has drifted so far away so it cannot be merged automatically (makes it easier for the receiver of the pull request).
- The master has code that you need.
In Hugo right now master contains Windows fixes needed to get the build go green.
So with my pull request Angled quotes, here is what I did:
Note, here is my remote setup (this is my preferred setup; use git remote … to get there):
bjornerik git@github.com:bjornerik/hugo.git
origin git@github.com:spf13/hugo.git
So I start by getting the latest from spf13:
git checkout master
git pull
git checkout feature/quotes-of-angles
git rebase master
At this point either all is OK or you have some merge conflict.
If conflict edit the file(s) in conflict manually or use a conflict solver tool. In my case it was some messed up imports in page.go.
Resolve conflict by:
git add .
git rebase --continue
Then force push to GitHub (force pushing is usually a bad thing, but in this case just the right medicine)
git push -f bjornerik feature/quotes-of-angles
And viola, my PR goes green:
With Git there are several ways to Rome, but the above works for me.