2014-05-25 5 views
4

저는 여기에서 아주 단순한 것을 간과하고 있습니다 만, 나는 그것을 보지 않을 것입니다. 명령git difftool이 git diff를 실행합니다.

webstorm diff ~/test.txt ~/test2.txt 

은 JetBrains 그래픽 diff 도구를 실행합니다. 나는 자식 1.8.3.2을 실행하고

[diff] 
    tool = webstorm 
[difftool "webstorm"] 
    cmd = webstorm diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") 
[difftool] 
    prompt = false 

을 포함하는 자식의 .config을 가지고 있어요 나는

git difftool ~/test.txt ~/test2.txt 

내가 터미널 창에서 다음을 얻을 명령을 실행하면

diff --git a/home/mark/test.txt b/home/mark/test2.txt 
index 7379ce2..6ce16f1 100644 
--- a/home/mark/test.txt 
+++ b/home/mark/test2.txt 
@@ -1,2 +1,2 @@ 
-blah 
+bluergh 

내가 뭘 잘못하고 있니?

+0

은 어쩌면 당신은'webstorm'의 절대 경로를 통과해야? –

+0

webstorm 폴더가 PATH에 있습니다 – baldmark

+0

나는 그것이 이미 경로에 있다는 것을 알고 있지만 절대 경로를 사용하려고 시도 했습니까? –

답변

0

방금 ​​같은 문제가있었습니다. 내 git diftool 구성이 내 ~/.gitconfig에 설정되어 잘 작동했지만 오늘 이상하게도 git difftool은 하나의 Repo에서 작동하지만 다른 하나는 git diff입니다.

수정 : git 2.11.0에서 git 2.11.1로 업데이트되었으며 문제가 사라진 것처럼 보입니다.

git 2.11.1 release notes에는 difftool 관련 회귀 분석이 언급되어 있습니다. 설명 된 문제는 내가 본 것이 아니지만 어쨌든 해결 된 픽스입니다.

1

실행 :

GIT_TRACE=1 git difftool --tool-help 

--tool와 함께 사용 될 수 있으며, DIFF 도구 목록을 인쇄 할 수는 사용할 수 없습니다.

[difftool "webstorm"] 
    cmd = webstorm diff "$LOCAL" "$REMOTE" 

또는 바이너리 또는 스크립트, 예를 들어, 경로를 지정하여 :


둘째 나는 다음과 같은 간단한 예는 더 잘 작동 할 수있다 믿는다 더 구체적으로

git config --get-regex diff 

또는 (당신의 도구 이름으로 webstorm 대체) :로 DIFF 구성이

[difftool] 
    prompt = NO 
    external = /usr/local/bin/diffmerge 

확인

git config --get difftool.webstorm.cmd 

아직하지 않는 경우 새로운 저장소에서 테스트합니다. .

mkdir ~/git_test && cd ~/git_test 
git init && touch file && git add file && git commit -m'Adds file' -a 
echo changed >> file 
GIT_TRACE=1 git difftool 

위의 경우, 저장소 구성에 예기치 않은 사항이 없는지 확인하십시오. 예 : 당신이 병합 상태에 있다면

more "$(git rev-parse --show-toplevel)"/.git/config 

(git status 확인) 대신, 예를 mergetool를 사용할 필요가

git mergetool 

있는 도구를 지정 -t tool을 추가합니다. git mergetool --tool-help에 의해 이용 가능한리스트.


man git-difftool 참조 :

CONFIG VARIABLES 
     git difftool falls back to git mergetool config variables when the difftool equivalents have not been 
     defined. 

     diff.tool 
      The default diff tool to use. 

     diff.guitool 
      The default diff tool to use when --gui is specified. 

     difftool.<tool>.path 
      Override the path for the given tool. This is useful in case your tool is not in the PATH. 

     difftool.<tool>.cmd 
      Specify the command to invoke the specified diff tool. 

      See the --tool=<tool> option above for more details. 

     difftool.prompt 
      Prompt before each invocation of the diff tool. 
관련 문제