当我输入时git diff,我想用我选择的视觉差异工具(Windows上的SourceGear"diffmerge")查看输出.如何配置git来执行此操作?
在我的存储库中,如果我输入
$ git diff some-file
Run Code Online (Sandbox Code Playgroud)
要么
$ git difftool some-file
Run Code Online (Sandbox Code Playgroud)
我得到了终端差异显示.我认为这不应该发生,因为我已经设置了一个外部差异工具,如输出所示git config -l:
$ git config -l
user.name=blah blah
user.email=blah blah
http.sslverify=true
diff.external=/home/daniel/bin/git-diff <--This is the important line
push.default=simple
core.filemode=false
core.editor=gedit
alias.tree=log --all --graph --decorate=short --color --format=format:'%C(bold blue)%h%C(reset) %C(auto)%d%C(reset)
%C(black)[%cr]%C(reset) %x09%C(black)%an: %s %C(reset)'
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.url=https://daniel@skynet/git/pyle.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.daniel.remote=origin
branch.daniel.merge=refs/heads/daniel
Run Code Online (Sandbox Code Playgroud)
该diff.external行中引用的git-diff文件如下所示
#!/bin/bash
meld $2 $5
Run Code Online (Sandbox Code Playgroud)
为什么不git diff援引融合?
如果我设置git config -l了以下行,我会得到相同的行为:
diff.tool = meld
Run Code Online (Sandbox Code Playgroud)
要么
diff.external = usr/bin/meld
Run Code Online (Sandbox Code Playgroud)
注意 …