简体   繁体   English

Git mergetool cmd找不到要合并的文件,merge cmd可以

[英]Git mergetool cmd finds no files to be merged, merge cmd does

I am trying to use WinMerge as my mergetool in git. 我正在尝试使用WinMerge作为git中的mergetool。 I want to merge branches so i checkout out the branch I want to merge into and type: 我想合并分支,所以我签出要合并到的分支并键入:

git mergetool -myotherbranch- git mergetool -myotherbranch-

I get the message: No files need merging. 我收到消息:无需合并文件。

I then ran get merge -myotherbranch- and it auto resolved a number of files and found 3 conflicts. 然后,我运行get merge -myotherbranch-,它自动解决了许多文件,发现3个冲突。 I didn't merge these files yet. 我还没有合并这些文件。 I tried running the mergetool again and it still says there are no files to be merged. 我尝试再次运行mergetool,但仍然说没有要合并的文件。

Here is my .gitconfig: 这是我的.gitconfig:

[mergetool]
  prompt = false
  keepBackup = false
  keepTemporaries = false
[merge]
  tool = winmerge
[mergetool "winmerge"]
  name = WinMerge
  trustExitCode = true
  cmd = "/c/Program\\ Files\\ \\(x86\\)/WinMerge/WinMergeU.exe" -u -e -dl \"Local\" -dr \"Remote\" $LOCAL $REMOTE $MERGED

Why does the merge tool not recognize the differences? 为什么合并工具无法识别差异?

https://git-scm.com/docs/git-mergetool : https://git-scm.com/docs/git-mergetool

[Doc] git-mergetool - Run merge conflict resolution tools to resolve merge conflicts [Doc] git-mergetool-运行合并冲突解决工具以解决合并冲突

git mergetool doesn't do merges, it only helps to resolve conflicts. git mergetool不进行合并,它仅有助于解决冲突。 So first you need to run git merge , get your 3 conflicts and the run git mergetool to resolve those conflicts. 因此,首先需要运行git merge ,获取3个冲突,然后运行git mergetool来解决这些冲突。

[OP] I tried running the mergetool again and it still says there are no files to be merged. [OP]我尝试再次运行mergetool,但仍然说没有要合并的文件。

Can you show output from git status ? 您可以显示git status输出吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM