HACKER Q&A
📣 ctenb

What is your favorite tool to resolve Git merge conflicts?


What is your favorite tool to resolve Git merge conflicts?


  👤 ZeroGravitas Accepted Answer ✓
There's a big long nerdy blog post about it (where I learned this technique) but basically many tools will throw away information and take you back to the start of a tricky merge. With the right settings, you can leave all the easy bits done and see exactly what caused the problem.

I think the guy was campaigning to make it the default so it may be in some tools now.

I'll see if I can Google it up.

edit, think this is it:

https://www.eseth.org/2020/mergetools.html


👤 btschaegg
Might be too late already, since this is already 8h old and does not have too many answers, but: As for me: A text editor and a text search for `<<<<`.

Now as for why, and in the hopes that someone here could give me a hint to better existing tooling: I usually run into conflicts with `git rebase`, not `git merge`. And no tool I have available gives me the important information about a conflict when rebasing a longer branch:

- What exactly is the conflicting commit I'm currently rebasing? How does its diff look like?

- What is the conflicting commit on the target branch? How does its diff look like?

Note that those two questions are much more important than the "snapshot 1, snapshot 2, result" view most merge tool provide. A conflict means two commits change the same region of code for reasons, and those reasons matter. It's mostly understanding them that makes the resolution possible, and reconstructing that information can be a huge headache.

Anyone know about such history-aware tooling for handling merge conflicts?


👤 ctenb
I've used kdiff3 a lot on windows. It's not bad, shows a readable 3-way-diff format (which I need to stretch over two screens to read the full lines). Reasonably fast startup too. But it lacks any sort of advanced editing functionality, such as undo.

👤 zachmjr

👤 jaycox2931