What is the default editor for git on windows, and where is the executable?

Viewed 9430

I just have the official git for windows 2.7.2 installed on my new windows. When I executed git commit on PowerShell without -m, I found the default editor is accidentally handy. So I would like to use it outside git, by adding it to the PATH environment variable, but I don't know its name.

I'm not sure if the editor is from any other environments, since it's a new win10 system I just installed PuTTY and MinGW.

I have checked git config --global core.editor and other git setting files but the editor entry is always empty.

Could anyone tell me how to use whatever that editor is outside git commit?

4 Answers

I suppose that every installation is different, especially now that this question is a little bit old, but for the Git bundled with Visual Studio 2017 (Windows 10) at the time of this writing, it is definitely Vim and the binary is located at:

C:\Program Files\Git\usr\bin\vim

In 2019/2020 at least for me it the default is nano in

C:\Program Files\Git\usr\bin\nano.exe

You can run in powershell with

& 'C:\Program Files\Git\usr\bin\nano.exe' <filename>

note AFAICT vim is still in there too but nano is arguably more beginner friendly since it is less modal, uses slightly more standard keys and lists the important ones at the bottom

Related