问题描述
当我执行 git difftool
时,显示所有文件在左侧栏中有所变化:
Windows中有任何diff-tool会显示这样的内容文件列表?
(我不希望该工具在单独的窗口中同时打开所有文件,我正在寻找一个窗口将显示已更改文件的列表,并且我应该可以单击某个特定文件以查看其差异,如Kaleidoscope屏幕截图所示)
<$ c $ c> git difftool --dir-diff
注意:在Windows上,需要管理员权限创建符号链接。
$ b
$ git difftool -d --symlinks [< commit> [< commit>]]
[别名]
d = difftool -d --symlinks
但这需要:
$ b $ li>创建git mklink
命令: >
C:\程序文件(x86)\Git\libexec\git-core\git-mklink:
#!/ bin / sh
cmd.exe / cmklink \$ 2 \\$ 1 \> / dev / null
- 修补msysgit 1.8.3:
$ b cd / c / Program \ Files \ \(x86 \)/ Git / libexec / git-core /
$ patch
使用
git-difftool。 patch
:
--- git-difftool Sun Jun 2 11:28:06 2013
+++ git -difftool Tue Jul 9 00:42:02 2013
@@ -283,7 +283,7 @@
exit_cleanup($ tmpdir,1);如果($ symlinks){
- symlink($ workdir / $ file,$ rdir / $ file)或
+!system(git ,mklink,$ workdir / $ file,$ rdir / $ file)或
exit_cleanup($ tmpdir,1);
} else {
copy($ workdir / $ file,$ rdir / $ file)或
@@ -448,7 +448,7 @@
my $ indices_loaded = 0;
为我的$文件(@worktree){
- 接下来如果是$ symlinks&& -l$ b / $ file;
+ next if $ symlinks;
next if! -f$ b / $ file;
if(!$ indices_loaded){
When I do a
git difftool
, Kaleidoscope shows me all the files that have changed in the left sidebar:http://www.kaleidoscopeapp.com/static/img/screenshots/Changeset_Blocks.png
Is there any diff-tool in Windows that would show me such a list of files?
(I don't want the tool to open all the files at the same time in separate windows. I'm looking for a single window that will show me the list of files changed, and I should be able to click on a particular file to see its diff, as shown in the Kaleidoscope screenshot)
解决方案You can use git difftool in a way which lists all the files (git1.8+ recommended):
git difftool --dir-diff
You can then integrate it with a BeyondCompare for instance.
Or with WinMerge:
[diff] tool = winmerge [difftool "winmerge"] path = C:/Program Files (x86)/WinMerge/winmergeu.exe cmd = \"C:/Program Files (x86)/WinMerge/winmergeu.exe\" -r -u \"$LOCAL\" \"$REMOTE\"
All that with:
$ git difftool [<commit> [<commit>]]
The only problem is the git diff-tool, on Windows, is described in this blog post, by nitoyon.
Note: On Windows, administrator privileges is required to create symbolic links.
$ git difftool -d --symlinks [<commit> [<commit>]]
[alias] d = difftool -d --symlinks
But that requires:
- to create a
git mklink
command:
C:\Program Files (x86)\Git\libexec\git-core\git-mklink: #!/bin/sh cmd.exe /c "mklink \"$2\" \"$1\"" > /dev/null
- to patch msysgit 1.8.3:
cd /c/Program\ Files\ \(x86\)/Git/libexec/git-core/ $ patch
With
git-difftool.patch
:--- git-difftool Sun Jun 2 11:28:06 2013 +++ git-difftool Tue Jul 9 00:42:02 2013 @@ -283,7 +283,7 @@ exit_cleanup($tmpdir, 1); } if ($symlinks) { - symlink("$workdir/$file", "$rdir/$file") or + !system("git", "mklink", "$workdir/$file", "$rdir/$file") or exit_cleanup($tmpdir, 1); } else { copy("$workdir/$file", "$rdir/$file") or @@ -448,7 +448,7 @@ my $indices_loaded = 0; for my $file (@worktree) { - next if $symlinks && -l "$b/$file"; + next if $symlinks; next if ! -f "$b/$file"; if (!$indices_loaded) {
这篇关于在Windows中使用Git difftool以查看除文件差异(万花筒)之外的所有已更改文件的列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
- to create a