首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么git合并工具说“没有文件需要合并”?

为什么git合并工具说“没有文件需要合并”?
EN

Stack Overflow用户
提问于 2015-08-29 20:34:29
回答 1查看 3.4K关注 0票数 4

我正在尝试将BeyondCompare4配置为我在git中的扩散工具和合并工具。我使用的是git版本2.5.0窗口1。到目前为止,BeyondCompare4是一个很好的工具,但不是一个合并工具。

在我的主分支中,我运行git mergetool branch3,它使用No files need merging进行响应

但是当我运行git diff branch3时,我可以在一个文件中看到几种类型的差异(通常在同一行中)。如果我只运行git merge branch3,它就会启动合并过程并停止冲突。那么,为什么git mergetool不以同样的方式为我工作呢?

这个链接暗示了git config --global core.trustctime false,我尝试了它,但没有结果:git mergetool reports "No files need merging"

这个链接提示重新播放可能是一个问题,所以我也尝试了git config --global rerere.enabled false,但没有运气:git tells me that I Merge conflict, but also tells me that no files need merging

这就是我的.gitconfig的样子:

代码语言:javascript
复制
[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路径更改为虚假的东西,以查看是否可以得到错误。如果我改变了扩散工具,我就会发现系统错误,找不到路径。但是如果我在mergetool上更改它,它就会不停地说“没有文件需要合并”,这让我相信BeyondCompare4甚至没有运行。

谢谢您的任何想法,为什么git mergetool会提前停止发送这条消息。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-29 21:15:07

当您处于需要解决冲突的状态时,即在合并导致冲突之后,您应该使用git mergetool

代码语言:javascript
复制
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

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32290405

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档