Link to home
Start Free TrialLog in
Avatar of elepil
elepil

asked on

Git config issue, won't use my text editor called Notepad++.exe

Of all my luck, my favorite text editor in Windows has a filename of Notepad++.exe. I think those plus signs are causing a problem. Here is the kind of error I'm getting:

/* I'm trying to revert a commit ... */
D:\git_root\explore_california [master]> git revert fabab344b6fd94c77
/* I get this message, that it can't find my text editor, notepad++.exe */
d:\Sharware\Notepad++\notepad++.exe: line 1: d:SharwareNotepad++notepad++.exe: command not found
error: There was a problem with the editor 'd:\Sharware\Notepad++\notepad++.exe'. 

Open in new window


When I do a git config --list, this is how the entry for my text editor looks like:

core.editor=d:\Sharware\Notepad++\notepad++.exe

Open in new window


I've tried doing a git config core.editor="D:\\shareware\\Notepad\+\+\\notepad\+\+.exe", thinking that I had to escape out the plus signs, but it still won't work.

Can anyone tell me what's wrong? I'm hoping someone out there is using notepad++.exe as their text editor for Git, were you able to make it work?

Thanks.
Avatar of Phil Davidson
Phil Davidson
Flag of United States of America image

Have you tried single quotes without escape characters?  Is this a .bash file in Linux?  A .bat file in Windows?  PowerShell?
Avatar of Dave Baldwin
'sharware' != 'shareware'.
Avatar of elepil
elepil

ASKER

I know. That directory name dates back to when Windows was still limited to 8-character filenames. And I just kind of stuck with it.
Avatar of elepil

ASKER

To Phil Davidson, thanks for responding.

Yes, this is PowerShell. I just downloaded Git and I'm running it on Windows, that's why there is a drive letter and I was using backslashes for directory delimiters. The config file originally did not have quotes around the pathname to the text editor. Putting double or single quotes causes Git to fail to load the config file.
ASKER CERTIFIED SOLUTION
Avatar of Phil Davidson
Phil Davidson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of elepil

ASKER

Phil, I got it resolved. What I had to do was add the directory name to my PATH environment variable, and then:

git config --global core.editor notepad++.exe

It seems to work without the pathname, it somehow just wants the .exe filename.

Thanks for your efforts though.