Trong kho của tôi, nếu tôi gõTại sao `git diff` không gọi công cụ tìm khác biệt bên ngoài?
$ git diff some-file
hoặc
$ git difftool some-file
tôi nhận được màn hình hiển thị khác trong thiết bị đầu cuối. Tôi nghĩ rằng điều này không nên xảy ra, bởi vì tôi đã thiết lập một công cụ diff bên ngoài, như thể hiện bởi đầu ra của 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://[email protected]/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
File git-diff tham chiếu trong dòng diff.external
trông như thế này
#!/bin/bash
meld $2 $5
Tại sao không git diff
gọi meld?
tôi nhận được hành vi tương tự nếu tôi đặt mọi thứ lên để git config -l
có dòng sau:
diff.tool = meld
hoặc
diff.external = usr/bin/meld
Note: kho khác trên máy tính của tôi không có vấn đề này.
liên quan, nhưng không tương đương, SO câu hỏi:
- What is the difference between
git diff
andgit difftool
? - Cannot make git diff use diff.external for external diff tool
Tại sao bạn sử dụng đối số thứ hai và thứ năm? – merlin2011
@ merlin2011: sự hiểu biết của tôi là git diff chuyển bảy đối số vào công cụ tìm khác biệt bên ngoài và meld chỉ cần hai trong số chúng. – DanielSank