开发者

Why does msysgit sometimes try to open the (non-existent) file "$@"?

开发者 https://www.devze.com 2023-01-27 22:58 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号