2011-09-15 66 views
8

git config --global mergetool.bc3 "\"c:/program files (x86)/beyond compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""mergetool從.gitconfig被忽略?

git mergetool

/usr/lib/git-core/git-mergetool--lib: line 116: bcompare: command not found

這是非常奇怪的,因爲這兩個./.git/config~/.gitconfig看起來是正確的。沒有列出bcompare的條目。可以從.git/config~/.gitconfig以外的任何地方讀取或存儲配置?

回答

15

看起來像this guy的問題一樣。看來bc3是一個內置的工具名稱,git不會允許該名稱被覆蓋。嘗試使用除bc3以外的名稱。

我用「BeyondCompare3」

[mergetool "BeyondCompare3"] 
    path = C:/Program Files/Beyond Compare 3/bcomp.exe 
    cmd = \"C:/Program Files/Beyond Compare 3/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\" 
+1

這正是解釋發生了什麼。 –

0

如果你需要重寫的合併工具的路徑,你只需要設置變量mergetool.<tool>.path

自定義合併工具可以用mergetool.<tool>.cmd指定(對於無法比擬的3不應該是必要的),但形式mergetool.<tool>的變量有git mergetool沒有意義。如果你被指示從文檔中嘗試這個,也許你可以說這是可以修復的地方。

+0

如果你用完了cygwin,這是必要的。 –