如何使用kdiff获取目录git branch diff

Mah*_*vda 9 git diff difftool kdiff3

我用我的git配置了kDiff3.

我需要的是看到两个分支之间的目录差异.我跑的时候

git difftool <headbranch>

命令它逐个打开所有文件.但那不是我想要的.

ste*_*ste 17

git-difftool(1)现在满足了这个用例.只需使用--dir-diff(或-d)开关:

-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.
Run Code Online (Sandbox Code Playgroud)

例如:

git difftool -d --tool=kdiff3 10c25f0da62929cca0b559095a313679e4c9800e..980de1bbe1f42c327ed3c9d70ac2ff0f3c2ed4e1
Run Code Online (Sandbox Code Playgroud)

另见https://www.kernel.org/pub/software/scm/git/docs/git-difftool.html

  • 我也使用此命令,但还添加参数“--no-symlink”,以便我在 kdiff3 中所做的任何更改都将应用当前签出的工作目录。 (2认同)

edo*_*lin 1

你可以使用

git diff --name-status <other-branch>
Run Code Online (Sandbox Code Playgroud)

它列出了存在差异的文件,状态为 A/M/D。