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.
elepilAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Phil DavidsonCommented:
Have you tried single quotes without escape characters?  Is this a .bash file in Linux?  A .bat file in Windows?  PowerShell?
Dave BaldwinFixer of ProblemsCommented:
'sharware' != 'shareware'.
elepilAuthor Commented:
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.
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

elepilAuthor Commented:
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.
Phil DavidsonCommented:
"core.editor" has a decimal.  They (.) are not valid in variable names in PowerShell as far as I know.  It looks like you are trying to assign a value to the variable core.editor in PowerShell.  If you eliminate the decimal (aka period), you should be ok.  Is core.editor not a variable?

I think you may be able to do what you need with this article:

https://danlimerick.wordpress.com/2011/06/12/git-for-windows-tip-setting-an-editor/

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
elepilAuthor Commented:
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Git

From novice to tech pro — start learning today.