How to get directory git branch diff using kdiff
Asked Answered
A

4

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.

Annulment answered 9/11, 2012 at 11:12 Comment(0)
W
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

Wilkie answered 21/1, 2015 at 9:57 Comment(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.Since
The --no-symlink option will also quiet KDiff3's "Error: Conflicting File Types"Thermophone
H
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/
Haar answered 29/8, 2017 at 12:22 Comment(0)
S
1

You could use

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

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

Sgraffito answered 9/11, 2012 at 11:40 Comment(1)
Thanks, it helped. Also kDiff3 is good to compare directories. A/M/D is really a great help.Annulment
A
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

Archenemy answered 29/7, 2013 at 16:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.