First step, install KDiff3 .
This is not the most beautiful graphical interface in the world, but as soon as you get used to it, it is quite applicable and has the additional advantage of working with natural Git, without having to configure a lot.
In the second step, open .gitconfig (in your home directory, C:\Users\(username) or down the old Documents and Settings path) and add the following:
[diff] tool = kdiff3 [merge] tool = kdiff3 [mergetool "kdiff3"] path = C:/Program Files/KDiff3/kdiff3.exe keepBackup = false trustExitCode = false
Now all calls to git difftool and git mergetool should be the default for KDiff3.
That is all you need to be good! Much easier than worrying about all these packages.
You will find a good tutorial here (in great gitguru ):
git mergetool
The git mergetool command allows you to integrate these tools into the merge process. The start after merge conflicts has been identified, it goes through the files that need to be resolved, and provides the specified tool with the version information needed to trigger a three-way merge.
git mergetool already includes support for a number of open source and freely available merge tools: kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge and opendiff.
Support for additional tools, including DiffMerge and Araxis Merge, can be added through user configuration settings if there is a command line call:
git config --global mergetool.[tool].cmd [command-line call] git config --global mergetool.[tool].trustExitCode [true|false]
The --global flag is --global , so this option will be applied in all of your Git repositories.
The command line should accept the following file variables passed as parameters:
$LOCAL - The current version of the branch$REMOTE - Version for merging$BASE - Common Ancestor$MERGED - The file in which the results will be written
git mergetool will create versions as temporary files and set the variables accordingly before executing the tool command line.
If the tool returns the correct exit code after a successful or unsuccessful merge, then trustExitCode can be set to true. Otherwise, set it to false, so you will be asked to resolve merge conflicts for the file.
Conflict Merge
The sequence of commands for merging using mergetool will be
git merge git mergetool -t [tool] git add . git commit
You can specify the default tool using the merge.tool parameter
git config --global merge.tool [tool]
This will allow you to simply call
git mergetool
alt text http://gitguru.com/wp-content/uploads/2009/02/opendiff.png