Active2 months ago
What's the best tool for viewing and editing a merge in Git? I'd like to get a 3-way merge view, with 'mine', 'theirs' and 'ancestor' in separate panels, and a fourth 'output' panel.
Also, instructions for invoking said tool would be great. (I still haven't figure out how to start kdiff3 in such a way that it doesn't give me an error.)
Download DiffMerge 4.2. Visually compare and merge files on Windows, OS X, and Linux. There are a great many comparison tools available. Many do directories and files. Some even perform as merge tools (2 and 3 way). Of these some have already been mentioned in other answers and your choice will depend on what features you require, and how much you are prepared to pay for the tool.
The Beyond Compare team makes a fine diff tool for Windows (as well as Mac and Linux, by the way). It goes well beyond (pun intended) diffing simple text and also allows comparing PDF, Excel and image files.
My OS is Ubuntu.
the Tin Man139k2727 gold badges181181 silver badges261261 bronze badges
andyandy8,48199 gold badges2626 silver badges2727 bronze badges
closed as off-topic by Martijn Pieters♦Nov 27 '18 at 21:14
This question appears to be off-topic. The users who voted to close gave this specific reason:
- 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.' – Martijn Pieters
18 Answers
Meld is a diff/merge tool.
Here's how to install it on:
- Windows: 'The recommended version of Meld for Windows is the most recent release, available as an MSI from http://meldmerge.org'
You can configure your own merge tool to be used with '
git mergetool
'.Example:
And while you are at it, you can also set it up as your difftool for '
git difftool
':Note that in Unix/Linux you don't want the
$BASE
to get parsed as a variable by your shell - it should actually appear in your ~/.gitconfig file for this to work.Beyond Compare 3, my favorite, has a merge functionality in the Pro edition. The good thing with its merge is that it let you see all 4 views: base, left, right, and merged result. It's somewhat less visual than P4V but way more than WinDiff. It integrates with many source control and works on Windows/Linux. It has many features like advanced rules, editions, manual alignment...
The Perforce Visual Client (P4V) is a free tool that provides one of the most explicit interface for merging (see some screenshots). Works on all major platforms. My main disappointement with that tool is its kind of 'read-only' interface. You cannot edit manually the files and you cannot manually align.
PS: P4Merge is included in P4V. Perforce tries to make it a bit hard to get their tool without their client.
SourceGear Diff/Merge may be my second free tool choice. Check that merge screens-shot and you'll see it's has the 3 views at least.
Meld is a newer free tool that I'd prefer to SourceGear Diff/Merge: Now it's also working on most platforms (Windows/Linux/Mac) with the distinct advantage of natively supporting some source control like Git. So you can have some history diff on all files much simpler. The merge view (see screenshot) has only 3 panes, just like SourceGear Diff/Merge. This makes merging somewhat harder in complex cases.
PS: If one tool one day supports 5 views merging, this would really be awesome, because if you cherry-pick commits in Git you really have not one base but two. Two base, two changes, and one resulting merge.
the Tin Man139k2727 gold badges181181 silver badges261261 bronze badges
WernightWernight23.7k1818 gold badges103103 silver badges121121 bronze badges
My favorite visual merge tool is SourceGear DiffMerge
- It is free.
- Cross-platform (Windows, OS X, and Linux).
- Clean visual UI
- All diff features you'd expect (Diff, Merge, Folder Diff).
- Command line interface.
- Usable keyboard shortcuts.
9,9302222 gold badges8080 silver badges103103 bronze badges
kryger10k66 gold badges3838 silver badges5757 bronze badges
Mike F
vimdiff
Once you have have learned vim (and IMHO you should), vimdiff is just one more beautiful little orthogonal concept to learn. To get online help in vim:
This question covers how to use it: How do I use vimdiff to resolve a conflict?
If you're stuck in the dark ages of mouse usage, and the files you're merging aren't very large, I recommend meld.
Ciro Santilli 新疆改造中心996ICU六四事件168k3636 gold badges646646 silver badges518518 bronze badges
Andrew WagnerAndrew Wagner7,9841313 gold badges6161 silver badges7878 bronze badges
You can try P4Merge.
Visualize the differences between file versions with P4Merge. Resolve conflicts that result from parallel or concurrent development via color coding.
The features includes:
- Highlight and edit text file differences
- Choose to include or ignore line endings or white spaces
- Recognize line-ending conventions for Windows (CRLF), Mac (CR), and Unix (LF)
- Use command-line parameters and launch from non-Perforce applications
- Display line numbers when comparing and merging files
- Exclude files that are modified, unique, or unchanged
- Filter files by name or extension
- Organize modified assets in familiar file/folder hierarchy
- Compare JPEG, GIF, TIFF, BMP, and other file formats
- Extend using the Qt API
- Overlay images or display side-by-side
- Highlight differences on overlaid images
80.9k3434 gold badges451451 silver badges465465 bronze badges
RonRon
IntelliJ IDEA has a sophisticated merge conflict resolution tool with the Resolve magic wand, which greatly simplifies merging:
niutechniutech20.5k1111 gold badges7474 silver badges8787 bronze badges
Diffuse is my favourite but of course I am biased. :-) It is very easy to use:
Diffuse is a small and simple text merge tool written in Python. With Diffuse, you can easily merge, edit, and review changes to your code. Diffuse is free software.
kenorb80.9k3434 gold badges451451 silver badges465465 bronze badges
Derrick Moser
Araxis Merge http://www.araxis.com/mergeI'm using it on Mac OS X but I've used it on windows... it's not free... but it has some nice features... nicer on windows though.
ClintmClintm2,17122 gold badges2121 silver badges3434 bronze badges
If you are just looking for a diff tool beyond compare is pretty nice: http://www.scootersoftware.com/moreinfo.php
Nathan FegerNathan Feger14.8k99 gold badges5252 silver badges6868 bronze badges
You can change the tool used by git mergetool by passing
git mergetool -t=<tool>
or --tool=<tool>
. To change the default (from vimdiff) use git config merge.tool <tool>
.user35149user35149
So for the git merge, you can try:
- DiffMerge to visually compare and merge files on Windows, OS X and Linux.
- Meld, is a visual diff and merge tool.
- KDiff3, a diff and merge program), which compares or merges 2 or 3 text input files/dirs.
opendiff
(part of Xcode Tools on macOS), a command line utility which launches the FileMerge application from Terminal to graphically compare files or directories, including merging.
80.9k3434 gold badges451451 silver badges465465 bronze badges
I've tried a lot of the tools mentioned here and none of them have quite been what I'm looking for.
Personally, I've found Atom to be a great tool for visualizing differences and conflict resolution/merging.
As for merging, there aren't three views but it's all combined into one with colored highlighting for each version. You can edit the code directly or there are buttons to use whichever version of that snippet you want.
I don't even use it as an editor or IDE anymore, just for working with git. Clean UI and very straight-forward, plus it's highly customizable.
- You can start it from the command line and pass in a single file you want to open to, or add your project folder (git repo).
- I would also recommend project-manager as a very convenient way to navigate between projects without filling up your tree view.
- The only problem I've had is refreshing -- when working with large repositories atom can be slow to update changes you make outside of it. I just always close it when I'm finished, and then reopen when I want to view my changes/commit again. You can also reload the window with ctrl+shift+f5, which only takes a second.
And it's free of course.
Styx6,03366 gold badges2929 silver badges4040 bronze badges
Sean McCallumSean McCallum
I use different tools for merge and compare:
Fist could be called by:
Second is called when you use
git mergetool
.ephemerrephemerr
You can install ECMerge diff/merge tool on your Linux, Mac or Windows. It is pre-configured in Git, so just using
akjoshigit mergetool
will do the job.11.6k1313 gold badges8686 silver badges114114 bronze badges
ArmelArmel
If you do use visual studio, Team Explorer built in tool is a very nice tool to resolve git merge conflicts.
CharithCharith1,15011 gold badge1010 silver badges2020 bronze badges
gitx http://gitx.frim.nl/
Some bugs when working with large commit sets but great for browsing through changes and picking different changes to stage and then commit.
Blake LucchesiBlake Lucchesi
Not the answer you're looking for? Browse other questions tagged gitversion-controlmerge or ask your own question.
Active2 months ago
What's the best tool for viewing and editing a merge in Git? I'd like to get a 3-way merge view, with 'mine', 'theirs' and 'ancestor' in separate panels, and a fourth 'output' panel.
Also, instructions for invoking said tool would be great. (I still haven't figure out how to start kdiff3 in such a way that it doesn't give me an error.)
My OS is Ubuntu.
the Tin Man139k2727 gold badges181181 silver badges261261 bronze badges
andyandy8,48199 gold badges2626 silver badges2727 bronze badges
closed as off-topic by Martijn Pieters♦Nov 27 '18 at 21:14
This question appears to be off-topic. The users who voted to close gave this specific reason:
- 'Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.' – Martijn Pieters
18 Answers
Meld is a diff/merge tool.
Here's how to install it on:
- Windows: 'The recommended version of Meld for Windows is the most recent release, available as an MSI from http://meldmerge.org'
You can configure your own merge tool to be used with '
git mergetool
'.Example:
![Diff Merge Tool For Mac Diff Merge Tool For Mac](https://mac-cdn.softpedia.com/screenshots/DiffMerge_6.jpg)
And while you are at it, you can also set it up as your difftool for '
git difftool
':Note that in Unix/Linux you don't want the
$BASE
to get parsed as a variable by your shell - it should actually appear in your ~/.gitconfig file for this to work.Beyond Compare 3, my favorite, has a merge functionality in the Pro edition. The good thing with its merge is that it let you see all 4 views: base, left, right, and merged result. It's somewhat less visual than P4V but way more than WinDiff. It integrates with many source control and works on Windows/Linux. It has many features like advanced rules, editions, manual alignment...
The Perforce Visual Client (P4V) is a free tool that provides one of the most explicit interface for merging (see some screenshots). Works on all major platforms. My main disappointement with that tool is its kind of 'read-only' interface. You cannot edit manually the files and you cannot manually align.
PS: P4Merge is included in P4V. Perforce tries to make it a bit hard to get their tool without their client.
SourceGear Diff/Merge may be my second free tool choice. Check that merge screens-shot and you'll see it's has the 3 views at least.
Meld is a newer free tool that I'd prefer to SourceGear Diff/Merge: Now it's also working on most platforms (Windows/Linux/Mac) with the distinct advantage of natively supporting some source control like Git. So you can have some history diff on all files much simpler. The merge view (see screenshot) has only 3 panes, just like SourceGear Diff/Merge. This makes merging somewhat harder in complex cases.
PS: If one tool one day supports 5 views merging, this would really be awesome, because if you cherry-pick commits in Git you really have not one base but two. Two base, two changes, and one resulting merge.
the Tin Man139k2727 gold badges181181 silver badges261261 bronze badges
WernightWernight23.7k1818 gold badges103103 silver badges121121 bronze badges
My favorite visual merge tool is SourceGear DiffMerge
- It is free.
- Cross-platform (Windows, OS X, and Linux).
- Clean visual UI
- All diff features you'd expect (Diff, Merge, Folder Diff).
- Command line interface.
- Usable keyboard shortcuts.
9,9302222 gold badges8080 silver badges103103 bronze badges
kryger10k66 gold badges3838 silver badges5757 bronze badges
Mike F
vimdiff
Once you have have learned vim (and IMHO you should), vimdiff is just one more beautiful little orthogonal concept to learn. To get online help in vim:
This question covers how to use it: How do I use vimdiff to resolve a conflict?
If you're stuck in the dark ages of mouse usage, and the files you're merging aren't very large, I recommend meld.
Ciro Santilli 新疆改造中心996ICU六四事件168k3636 gold badges646646 silver badges518518 bronze badges
Andrew WagnerAndrew Wagner7,9841313 gold badges6161 silver badges7878 bronze badges
You can try P4Merge.
Visualize the differences between file versions with P4Merge. Resolve conflicts that result from parallel or concurrent development via color coding.
The features includes:
- Highlight and edit text file differences
- Choose to include or ignore line endings or white spaces
- Recognize line-ending conventions for Windows (CRLF), Mac (CR), and Unix (LF)
- Use command-line parameters and launch from non-Perforce applications
- Display line numbers when comparing and merging files
- Exclude files that are modified, unique, or unchanged
- Filter files by name or extension
- Organize modified assets in familiar file/folder hierarchy
- Compare JPEG, GIF, TIFF, BMP, and other file formats
- Extend using the Qt API
- Overlay images or display side-by-side
- Highlight differences on overlaid images
80.9k3434 gold badges451451 silver badges465465 bronze badges
RonRon
IntelliJ IDEA has a sophisticated merge conflict resolution tool with the Resolve magic wand, which greatly simplifies merging:
niutechniutechDiff Merge Tool
20.5k1111 gold badges7474 silver badges8787 bronze badges
Diffuse is my favourite but of course I am biased. :-) It is very easy to use:
Diffuse is a small and simple text merge tool written in Python. With Diffuse, you can easily merge, edit, and review changes to your code. Diffuse is free software.
kenorb80.9k3434 gold badges451451 silver badges465465 bronze badges
Derrick Moser
Araxis Merge http://www.araxis.com/mergeI'm using it on Mac OS X but I've used it on windows... it's not free... but it has some nice features... nicer on windows though.
ClintmClintm2,17122 gold badges2121 silver badges3434 bronze badges
If you are just looking for a diff tool beyond compare is pretty nice: http://www.scootersoftware.com/moreinfo.php
Nathan FegerNathan Feger14.8k99 gold badges5252 silver badges6868 bronze badges
You can change the tool used by git mergetool by passing
git mergetool -t=<tool>
or --tool=<tool>
. To change the default (from vimdiff) use git config merge.tool <tool>
.user35149user35149
So for the git merge, you can try:
- DiffMerge to visually compare and merge files on Windows, OS X and Linux.
- Meld, is a visual diff and merge tool.
- KDiff3, a diff and merge program), which compares or merges 2 or 3 text input files/dirs.
opendiff
(part of Xcode Tools on macOS), a command line utility which launches the FileMerge application from Terminal to graphically compare files or directories, including merging.
80.9k3434 gold badges451451 silver badges465465 bronze badges
I've tried a lot of the tools mentioned here and none of them have quite been what I'm looking for.
Personally, I've found Atom to be a great tool for visualizing differences and conflict resolution/merging.
As for merging, there aren't three views but it's all combined into one with colored highlighting for each version. You can edit the code directly or there are buttons to use whichever version of that snippet you want.
I don't even use it as an editor or IDE anymore, just for working with git. Clean UI and very straight-forward, plus it's highly customizable.
Free Diff Merge Tool
- You can start it from the command line and pass in a single file you want to open to, or add your project folder (git repo).
- I would also recommend project-manager as a very convenient way to navigate between projects without filling up your tree view.
- The only problem I've had is refreshing -- when working with large repositories atom can be slow to update changes you make outside of it. I just always close it when I'm finished, and then reopen when I want to view my changes/commit again. You can also reload the window with ctrl+shift+f5, which only takes a second.
And it's free of course.
Styx6,03366 gold badges2929 silver badges4040 bronze badges
Sean McCallumSean McCallum
I use different tools for merge and compare:
Fist could be called by:
Second is called when you use
git mergetool
.ephemerrephemerr
You can install ECMerge diff/merge tool on your Linux, Mac or Windows. It is pre-configured in Git, so just using
akjoshigit mergetool
will do the job.11.6k1313 gold badges8686 silver badges114114 bronze badges
ArmelArmel
If you do use visual studio, Team Explorer built in tool is a very nice tool to resolve git merge conflicts.
CharithCharith1,15011 gold badge1010 silver badges2020 bronze badges
gitx http://gitx.frim.nl/
Some bugs when working with large commit sets but great for browsing through changes and picking different changes to stage and then commit.
Blake LucchesiBlake Lucchesi