Using KDiff3 as a Git Diff and Merging Tool

KDiff3 can be used as a Git diff and merge tool.

Just add the following lines into your gitconfig file.

[diff]
        tool = kdiff3
[difftool "kdiff3"]
        path = <path to kdiff3 binary in your system>
[difftool]
        prompt = false
        keepBackup = false
        trustExitCode = false
[merge]
        tool = kdiff3
[mergetool]
        prompt = false
        keepBackup = false
        keepTemporaries = false
[mergetool "kdiff3"]
        path = <path to kdiff3 binary in your system>

Then to see the difference between two commits use git difftool first_hash second_hash --tool=kdiff3 --cc some_file_in_the_git_tree

To merge a branch with KDiff3 use git merge branch_name && git mergetool --tool=kdiff3

After resolving merging conflicts in the usual way it is enough to commit the changes to do the job.