14

I have configured kDiff3 with my git.

What I need is to see directory difference between two branches. when I run

git difftool <headbranch>

command it opens all files one by one. But that is not I want.

Marijn
  • 10,367
  • 5
  • 59
  • 80
Mahesh Chavda
  • 141
  • 1
  • 3

4 Answers4

20

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

ste
  • 316
  • 2
  • 7
  • 2
    I use this command as well, but also add the parameter `--no-symlink` so that any changes I make in kdiff3 will apply the current checked out working directory. – Robert Mar 25 '16 at 23:39
  • The `--no-symlink` option will also quiet KDiff3's "Error: Conflicting File Types" – jwd Aug 24 '22 at 21:53
2

Let's say, we have the two branches master and base In order to see the difference between these branches, just execute:

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

Then your preset diff tool should get started, in my case kdiff3. Or you can also use the --tool option to start another one: e.g. with vimdiff

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

or with kdiff3 the same way

git difftool -d --tool=kdiff3  base:src/ master:src/
Sedat Kilinc
  • 2,843
  • 1
  • 22
  • 20
1

You could use

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

It lists files with differences, with a status of A/M/D.

edoloughlin
  • 5,821
  • 4
  • 32
  • 61
1

I haven't found possibilities to see directory difference between two branches in a directory comparison mode using kdiff3 and standard git tools.

What could be done using standard tools (fix me if I am wrong:) is file by file comparison using difftool, and overview in console using:

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

But I have found Comprehensive Graphical Git Diff Viewer Script, that did the work for me as desired - to compare the whole directory in kdiff3.

The tool is just a shell script that creates branches-to-be-compared snapshots in /tmp folder and runs kdiff3 folder comparison on them.

Checkout the script here

lib
  • 2,918
  • 3
  • 27
  • 53
pershyn
  • 134
  • 6