I\'m trying out Git on Windows. I got to the point of trying \"git commit\" and I got this error:
Terminal is dumb but no VISUAL nor
This worked for me:
That's it!
NOTE: Sublime Text 3 is the editor I used for this example.
I've just had the same problem and found a different solution. I was getting
error: There was a problem with the editor 'ec'
I've got VISUAL=ec
, and a batch file called ec.bat
on my path that contains one line:
c:\emacs\emacs-23.1\bin\emacsclient.exe %*
This lets me edit files from the command line with ec <filename>
, and having VISUAL
set means most unixy programs pick it up too. Git seems to search the path differently to my other commands though - when I looked at a git commit
in Process Monitor I saw it look in every folder on the path for ec
and for ec.exe
, but not for ec.bat
. I added another environment variable (GIT_EDITOR=ec.bat
) and all was fine.
For Atom you can do
git config --global core.editor "atom --wait"
and similar for Visual Studio Code
git config --global core.editor "code --wait"
which will open up an Atom or Visual Studio Code window for you to commit through,
or for Sublime Text:
git config --global core.editor "subl -n -w"
I needed to do both of the following to get Git to launch Notepad++ in Windows:
Add the following to .gitconfig:
editor = 'C:/Program Files/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin
Modify the shortcut to launch the Git Bash shell to run as administrator, and then use that to launch the Git Bash shell. I was guessing that the context menu entry "Git Bash here" was not launching Notepad++ with the required permissions.
After doing both of the above, it worked.
Thanks to the Stack Overflow community ... and a little research I was able to get my favorite editor, EditPad Pro, to work as the core editor with msysgit 1.7.5.GIT and TortoiseGit v1.7.3.0 over Windows XP SP3...
Following the advice above, I added the path to a Bash script for the code editor...
git config --global core.editor c:/msysgit/cmd/epp.sh
However, after several failed attempts at the above mentioned solutions ... I was finally able to get this working. Per EditPad Pro's documentation, adding the '/newinstance' flag would allow the shell to wait for the editor input...
The '/newinstance' flag was the key in my case...
#!/bin/sh
"C:/Program Files/JGsoft/EditPadPro6/EditPadPro.exe" //newinstance "$*"
Based on VonC's suggestion, this worked for me (was driving me crazy):
git config --global core.editor "'C:/Program Files (x86)/Sublime Text 3/subl.exe' -wait"
Omitting -wait
can cause problems, especially if you are working with Gerrit and change ids that have to be manually copied to the bottom of your commit message.