25 Handling Conflicts with a GUI

Merging is often made easier with a GUI that displays each version of the code in question and allows you to choose which version you prefer. You can use git mergetool to launch a GUI tool to handle merge conflicts.

You can choose from several different merge tools. Their availability varies between platforms, and how you interact with a tool is slightly different for each one you use for merging. Generally, the local copy (the original that was in your branch before the merge) is displayed on the left, with the remote, new code on the right.

Common to all GUI merge tools is the ability to step through each change and choose which version you like. You must save those changes before exiting. git mergetool ...

Get Pragmatic Guide to Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.