A blog about mobile, maker, and embedded development.

Hard Merge Conflict Resolution in Git

You do a git merge foo and then sigh as you realize there’s a merge conflict in a file you know nothing about. You certainly don’t remember modifying it. You just want to take whatever changes are coming over from the other branch but you don’t want to apply a recursive merge strategy for the whole operation.

This tip is for you:

git checkout --theirs path/to/the/conflicted_file.c
git add path/to/the/conflicted_file.c

(Credit goes to Theodore Smith on Stackoverflow for this tip)