[英]why does git mergetool say “No files need merging”?
我正在嘗試將BeyondCompare4配置為git中的difftool和mergetool。 我正在使用git版本2.5.0.windows.1。 到目前為止BeyondCompare4作為difftool工作得很好但不是合並工具。
從我的主分支我運行git mergetool branch3
,它響應No files need merging
但是當我運行git diff branch3
我可以在一個文件中看到幾種類型的差異(通常在同一行上)。 如果我只是運行git merge branch3
它會啟動合並過程並停止CONFLICT。 那么為什么git mergetool
不會以同樣的方式為我工作呢?
這個鏈接建議git config --global core.trustctime false
我沒試過就試過了: git mergetool報告“沒有文件需要合並”
這個鏈接建議rerere可能是個問題,所以我嘗試了git config --global rerere.enabled false
也沒有運氣: git告訴我合並沖突,但也告訴我沒有文件需要合並
這就是我的.gitconfig的樣子:
[diff]
tool = bc
[difftool]
prompt = false
[difftool "bc"]
trustExitCode = true
cmd = 'c:/program files (x86)/beyond compare 4/bcomp.exe' $LOCAL $REMOTE
[merge]
tool = bc
[mergetool]
prompt = false
[mergetool "bc"]
trustExitCode = true
cmd = 'c:/program files (x86)/beyond compare 4/bcomp.exe' $LOCAL $REMOTE $BASE $MERGED
我甚至嘗試修改.gitconfig將bcomp4.exe路徑更改為虛假的東西只是為了看看我是否會收到錯誤。 如果我對difftool進行更改,我會收到有關系統無法找到路徑的錯誤。 但是,如果我在mergetool上更改它,它只是說“沒有文件需要合並”,這讓我相信BeyondCompare4甚至沒有運行。
感謝任何想法,為什么git mergetool
會提前停止該消息。
當您處於需要解決沖突的狀態時,即在合並導致沖突之后,您應該使用git mergetool
。
git checkout master
git merge branch3
# the merge reports conflicts which we need to resolve
git mergetool
git add -u
git commit -m "a merge commit message"
有關解決與meregetool沖突的更多信息, 請訪問https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging#Basic-Merge-Conflicts
請git help mergetool
以獲取選項。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.