I'm using Git on Windows 7 and Sublime Text 2 as my editor.
In .gitconfig, there is this line: editor = subl -n -w
That is an incorrect entry, because I had tried to set Sublime Text as the editor for Git by using the command git config --global core.editor "subl -n -w"
as described here.
but, in haste, I had not read the full instructions and didn't notice that I needed to have installed subl first. Also, this only works on a Mac!
On top of that I had mistyped the command as subi -n -w
So now, when I do:
git config --global --edit
I get the error:
error: There was a problem with the editor 'subi -n -w'
I assume that's because I had previously mistakenly mistyped the command (see above)
So then I tried setting the editor with:
git config --global core.editor "'c:/program files/sublime text 2/sublime_text.exe' -w"
as recommended here, which inserts the following line in .gitconfig
:
editor = 'c:/program files/sublime text 2/sublime_text.exe' -w
I have also tried manually editing that line to:
editor = C:/Program Files/Sublime Text 2/sublime_text.exe -w
but I still get the error when doing git commit
or git config --global --edit
I have tried to use unset:
git config --global --unset-all core.editor
and then re-input Sublime Text as the editor (manually and using command line). I still get the error message and Sublime Text is not launched (for git commit). How do I get rid of the error message and successfully launch Sublime Text as the editor?