How to get git branch diff directory using kdiff

I configured kDiff3 using git .

I need to see the difference between the two branches. when i run

git difftool <headbranch>

the command opens all files one at a time. But I do not want this.

+7
source share
4 answers

git -difftool (1) now satisfies this use case. Just use the -dir-diff (or -d) switch:

 -d --dir-diff Copy the modified files to a temporary location and perform a directory diff on them. This mode never prompts before launching the diff tool. 

So for example:

 git difftool -d --tool=kdiff3 10c25f0da62929cca0b559095a313679e4c9800e..980de1bbe1f42c327ed3c9d70ac2ff0f3c2ed4e1 

See also https://www.kernel.org/pub/software/scm/git/docs/git-difftool.html

+13
source

I did not find the opportunity to see the difference in the directory between the two branches in the directory comparison mode using kdiff3 and standard git tools.

What can be done using standard tools (correct me if I am mistaken :) - this is a file comparison using diffftool and an overview on the console with:

 git diff --name-status <other-branch> 

But I found a comprehensive graphical git Diff Viewer Script that did the job for me at will - compare the entire directory in kdiff3.

A tool is just a shell script that takes snapshots mapped to branches in the / tmp folder and starts comparing kdiff3 directories on them.

Checkout the script here

+1
source

you can use

 git diff --name-status <other-branch> 

It lists files with differences with A / M / D status.

0
source

Let's say we have two branches master and base. To see the difference between these branches, simply do:

 git difftool -d base:src/ master:src/ 

Then your predefined diff tool should start working, in my case kdiff3. Or you can also use the --tool option to start another: for example with vimdiff

 git difftool -d --tool=vimdiff base:src/ master:src/ 

or with kdiff3 in the same way

 git difftool -d --tool=kdiff3 base:src/ master:src/ 
0
source

All Articles