I've seen posts about using notepad++ and other editors for git, but not one about using PN2.

I've tried variations on the following, but none of them seem to work:

git config --global core.editor "'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w"

I just get errors like the following (this is after "git commit --amend"):

'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w: -c: line 0:
unexpected EOF while looking for matching `''
'C:\Program Files (x86)\Programmer's Notepad\pn.exe -allowmulti' -w: -c: line 1:
syntax error: unexpected end of file
error: There was a problem with the editor ''C:\Program Files (x86)\Programmer's
Notepad\pn.exe -allowmulti' -w'.
Please supply the message using either -m or -F option.

Is it possible to get this to work?

有帮助吗?

解决方案

The editor is launched by git using bash scripting. So you should ensure your quoting is for the bash shell. You used single quotes but you have an embedded single quote in the directory name. You should probably also use forward slashes and make it unixy. Seethis answer for an example that uses Notepad++. In your case, I think the following should be ok:

git config --global core.editor "\"C:/Program Files (x86)/Programmer's Notepad/pn.exe\" -allowmulti -w"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top