Why does msysgit sometimes try to open the (non-existent) file "$@"?
I'm using msysgit on Windows, and occasionally, when it should open my editor to allow me to edit a commit message or something, it tries to open a file called $@
instead. The file doesn't exist, so Notepad++ says "The file '$@' doesn't exist; would you like to create it?"
My .git/config looks like开发者_高级运维:
[core]
editor = C:/Program\\ Files/notepad++/notepad++.exe
I had exactly the same problem too. I have tried to write this string in different ways. Finally I've found a right variant.
[core]
editor = 'C:/Program\\ Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin
The single quotes must be presented. I don't know why or how, but it works (in my case). May somebody will explain the reason of such behavior. I hope this comment is helpfull.
I haven't found exactly why this is happening, but searching around in the msysgit Google group led me to the conclusion that it seems to have something to do with the space in "Program Files." What seems to solve the problem is adding C:\Program Files\Notepad++
to the PATH
environment variable, and then switching the git config to just notepad++
. I would still like to know why this wasn't working, and why this solution apparently fixes it, though.
精彩评论