We are evaluating github for our Katello open-source project. While I like plain git more, I have to say github has pretty convenient merge reviews and it's very fast (Rackspace UK-based datacenters are faster than US-based fedorahosted.org; at least for me).
Anyway, today I hit my very first git conflict during git pull review process. For some time, github shows this very nice Automerge button, but it only works when request can be clearly merged. Otherwise, github shows the following message:
This pull request cannot be automatically merged.
What to do now? There are many approaches one can take. I like to have my own repo cloned while upstream repository is added in read-only mode to prevent accidental pushes (I use separate fork for upstream works like tagging). Manual merge would lead to switching over to the second fork, fetching, merging. And I would like to fix errors and let folks to review it again.
So the approach I took today was pretty simple. I merged upstream changes into my master, created new branch topic2 and rebased master on top of it. Git push gives the flexibility of another review round. Now, in the console it would look like:
git co topic
# coding work
git push origin master topic
# review was done but github shows the above message
git co master
git fetch upstream
git merge upstream/master
git co topic
git co -b topic2
git rebase master
# solve conflicts here - I use "git mergetool" command with "meld" tool
git push origin master topic2
# review, merge
By the way "co" is my "checkout" alias. Let me know what you do in these cases!
When github says I cannot merge
April 27, 2012