2012-11-09 90 views

回答

0

你可以使用

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

它列出的文件有差異,A/M/d的狀態。

+0

謝謝,它幫助。另外kDiff3是很好的比較目錄。 A/M/D確實非常有幫助。 –

1

我還沒有發現使用kdiff3和標準git工具在目錄比較模式下查看兩個分支之間的目錄差異的可能性。

什麼能使用標準工具(整我,如果我錯了:)是使用文件比較文件使用difftool,並概述在控制檯來完成:

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

但我發現Comprehensive Graphical Git Diff Viewer Script,該做的根據需要爲我工作 - 比較kdiff3中的整個目錄。

該工具只是一個shell腳本,它在/ tmp文件夾中創建要比較的分支並在其上運行kdiff3文件夾比較。

結帳腳本here

13

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. 

因此,例如:

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

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

+0

我也使用這個命令,但也添加了參數'--no-symlink',以便我在kdiff3中所做的任何更改都將應用當前簽出的工作目錄。 – Robert

0

見比方說,我們有兩個分支master and base 爲了看到di這些分支之間fference,只需要執行:

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

然後你預設的diff工具應上手,在我的情況kdiff3。 或者您也可以使用--tool選項啓動另一個: 與Vimdiff可以

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

kdiff3以同樣的方式

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