The following:
C:\prog\git>git config --global core.editor C:/prog/git/npp.sh
C:/prog/git/npp.sh:
#!/bin/sh
"c:/Program Files/Notepad++/notepad++.exe" -multiInst "$*"
does work. Those commands are interpreted as shell script, hence the idea to wrap any windows set of commands in a sh
script.
More details on the SO question How can I set up an editor to work with Git on Windows?
Note the -multiInst' option, for ensuring a new instance of notepad++ for each call from Git.
If you want to place the script 'npp.sh' in a path with spaces (as in 'c:\program files\...
,'), you have three options:
either try to quote the path (single or double quotes), as in
git config --global core.editor 'C:/program files/git/npp.sh'
or try the shortname notation (not fool-proofed)
git config --global core.editor C:/progra~1/git/npp.sh
or (my favorite) place npp.sh in a directory part of your %PATH%
environment variable. You would not have then to specify any path for the script.
git config --global core.editor npp.sh