When I try to commit using Magit, I get the following error message:
1 c:/Users/chanyoungs/AppData/Local/GitHub/PortableGit_f02737a78695063deace08e96d5042710d3e32db/cmd/git.exe … "commit" "--"
error: cannot spawn sh: No such file or directory
error: unable to start editor '"c:/Users/chanyoungs/Documents/Programming/emacs/emacs-25.1/bin/emacsclient.exe"' Please supply the message using either -m or -F option.
Here are my settings:
- Windows 10 64bit
- GNU Emacs 25.2.1 (x86_64-w64-mingw32) of 2017-04-24
- Magit ver. 20170425.638
- Git ver. 2.11.0.windows.3
- Running Daemon
Further checks:
- When I call git on cmd, it is called successfully
- When I call emacsclient on cmd, in is called successfully
- I tried running emacs with no other packages and get the same error
I searched for this error around and there are similar questions but I can't fix this with their suggestions. May be I'm not doing this right.
Any help or suggestions will be much appreciated.
git -c "alias.X=!x() { which \"$1\" | cygpath -mf -; }; x" X sh
in cmd? Doesc:/Users/chanyoungs/AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\usr\bin
exist?git -c "alias.X=!x() { which \"$1\" | cygpath -mf -; }; x" X sh
on cmd I get:error: cannot spawn sh: No such file or directory fatal: While expanding alias 'X': 'x() { which "$1" | cygpath -mf -; }; x': No such file or directory
2. Yes, I just tried to findc:/Users/chanyoungs/AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db\usr\bin
in cmd just now and I can confirm that it exists..../usr/bin/
directory not contain ash.exe
file? Can you runc:/Users/chanyoungs/AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db/git-bash.exe
and trywhich sh
in that shell? (and alsocygpath -m $(which sh)
if that doesn't error out)usr/bin/
folder does containsh.exe
2.c:/Users/chanyoungs/AppData\Local\GitHub\PortableGit_f02737a78695063deace08e96d5042710d3e32db/git-bash.exe
runsMINGW32
3.chanyoungs@DESKTOP-L4TTJ2L MINGW32 /c/Users/chanyoungs $ which sh
gives/usr/bin/sh
4.chanyoungs@DESKTOP-L4TTJ2L MINGW32 /c/Users/chanyoungs $ cygpath -m $(which sh)
givesC:/Users/chanyoungs/AppData/Local/GitHub/PortableGit_f02737a78695063deace08e96d5 042710d3e32db/usr/bin/sh.exe