6

I use git bash in Win7. After I upgrade to Git-2.5 when I merge conflict, git said Cannot execute shell C:/Program Files/Git/usr/bin/bash.

I have added the vim and git into path.

How can fix it? Thanks!

enter image description here

enter image description here

viscroad
  • 203
  • 2
  • 9
  • I have the same problem after upgrading to git 2.5 gvim diff stopped working. Same error as you, E810 followed by E97. I believe it has something to do with the way bash calls the external program but have not found any solution so far. – roqvist Sep 15 '15 at 14:00
  • I rollback to install git-1.9-preview, it works well with vimdiff. It is weird about this error. – viscroad Sep 16 '15 at 04:51
  • I pick up some other merge tools in windows. one is meld and another is p4merge. The latter one works on more intuitive way for me. But I also want to find some resolution for this error and drag me back to vimdiff. – viscroad Sep 16 '15 at 04:55

2 Answers2

4

try this command

MSYS_NO_PATHCONV=1 git mergetool

Git 2.5.3 Release Notes

xyz
  • 51
  • 7
  • Two things, 1) I think you meant `MSYS_NO_PATHCONV=1 git mergetool`, 2) I'd like to add that you can put the `export MSYS_NO_PATHCONV=1` in your `.bash_profile` or use an alias, something like `git config --global alias.mt MSYS_NO_PATHCONV=1 git mergetool` then use `git mt`... Also, there should be a way to correct this by doing `git config --global mergetool.vimdiff.cmd ` but I don't know what to put. – Captain Man Oct 06 '15 at 17:37
  • 1
    You should *never* use `MSYS_NO_PATCHCONV=1` "globally", the `export` thing is to global breaking commands ran after it. When this environment variable is set to 1, it will prevent msys2 runtime to automatically translate POSIX path of the form `/mingw64/bin/` to their Windows equivalent. This will break lots of tool not ready to handle POSIX paths. For example try out `MSYS_NO_PATHCONV=1 gitk` and it will fail without even launching anything. If it was a good sane default, it would already be set to 1. Good usage is on a per invocation basis. So,never put this in your `.bash_profile` please. – Matt Oct 07 '15 at 03:14
  • @Yang, please remove the `export` part of your answer as it will break stuff after invocation. Proper workaround is to use second invocation. See https://github.com/git-for-windows/git/issues/468 for bug report. – Matt Oct 07 '15 at 03:18
2

I added this to my vimrc and it seems to be working for me now with GIT 2.5 (I guess the shell variable was messed up)

set shell=$COMSPEC
roqvist
  • 327
  • 5
  • 12