Skip to content

Instantly share code, notes, and snippets.

@simonw
Created February 3, 2018 20:47
Show Gist options
  • Select an option

  • Save simonw/cfb0fea0493fa3fb1a51bed02f732b9a to your computer and use it in GitHub Desktop.

Select an option

Save simonw/cfb0fea0493fa3fb1a51bed02f732b9a to your computer and use it in GitHub Desktop.
How I fixed a tricky merge conflict

How I fixed a tricky merge conflict

I switched to another branch before the conflict.

git checkout -b fixbranch

Then I cherry-picked each commit that was failing to merge, one at a time.

For each of those cherry-picked commits I manually cleaned up any conflicts.

I then had a branch that I considered the "correct" branch - but I needed to replace master with it.

I followed https://stackoverflow.com/a/2862938/6083

git merge --strategy=ours master
git checkout master
git merge fixbranch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment