4

I am trying to configure git mergetool with vimdiff on Cygwin. I have set the the tool in my git config using:

git config --global merge.tool vimdiff

However, when I perform a merge that results in "Automatic merge failed; fix conflicts and then commit the result." and run:

git mergetool

I get: "No files need merging" even though git status clearly shows that I have an unmerged path.

There are several posts on SO with similar problems, but I have not been able to solve this issue with any of the solutions for the other questions. I have also removed all the lines of my .gitconfig with the except of git mergetool, and similarly, I have removed all the lines of my vimrc. Is there some other config file or some package I need (recall I am using Cygwin) to make git mergetool to open vimdiff? What am I missing? This is a trivial task on Linux.

1 Answers1

2

First, you can try with the latest Git 2.12.1 for Windows (no need for Cygwin: that distribution has its own bash), to see if the issue persists.

Second, make sure the conflitcs does not comes from files already committed with merge markers in them.

Finally, make sure to use git mergetool in the right path.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Indeed, using Git 2.12.1 for WIndows out of the box allows me to use `git mergetool` in Windows while in Cygwin, git mergetool returns "No files need merging". Note that I am not dealing with files already committed with merge markers and I am calling `git mergetool` from the correct path. I use Cygwin for development, so I would prefer to figure out why I cannot do the same thing with Cygwin's git. – mjellis1687 Mar 22 '17 at 12:38
  • @mjellis1687 Would the git bash be enough for your development need? – VonC Mar 22 '17 at 12:39
  • @mjellis1687 what is the version of git as deployment in Cygwin? – VonC Mar 22 '17 at 12:40
  • Cygwin has git 2.8.2-1 and 2.8.3-1. Currently, I have 2.8.3-1 although I have already tried both versions. My understanding of git bash is that it is a minimal Unix environment and does not have all the packages that Cygwin has, so I suppose one work-around is to use Cygwin and to use `git mergetool` in Git bash, but this does not seem extremely efficient. – mjellis1687 Mar 22 '17 at 13:01
  • @mjellis1687 the other approach, with Windows 10, is to use "bash on Ubuntu on Widnows": https://msdn.microsoft.com/en-us/commandline/wsl/about It has *most* of the packages you need. – VonC Mar 22 '17 at 13:08
  • @mjellis1687 If not, recompile Git in Cygwin: http://www.gizmoplex.com/wordpress/upgrade-git-to-latest-stable-release-in-cygwin/ or (more recent) https://gist.github.com/patrikbeno/92ec81e12896931b3f69 – VonC Mar 22 '17 at 13:08
  • Very well. I may give recompiling Git, but for now, I will switch between environments (Cygwin and Git bash). Thanks for the link to "bash on Ubuntu on Windows". – mjellis1687 Mar 23 '17 at 12:32