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 works for PowerShell and cmder 1.2 (when used with PowerShell). In file ~/.gitconfig
:
[core]
editor = 'c:/program files/sublime text 3/subl.exe' -w
How can I make Sublime Text the default editor for Git?
I also use Cygwin on Windows, but with gVim (as opposed to the terminal-based Vim).
To make this work, I have done the following:
git_editor.bat
) which contains the following:
"C:/Program Files/Vim/vim72/gvim.exe" --nofork "%*"
git_editor.bat
on in my PATH
.GIT_EDITOR=git_editor.bat
With this done, git commit
, etc. will correctly invoke the gVim executable.
NOTE 1: The --nofork
option to gVim ensures that it blocks until the commit message has been written.
NOTE 2: The quotes around the path to gVim is required if you have spaces in the path.
NOTE 3: The quotes around "%*" are needed just in case Git passes a file path with spaces.
This is my setup to use Geany as an editor for Git:
git config --global core.editor C:/path/to/geany.bat
with the following content in geany.bat
:
#!/bin/sh
"C:\Program Files\Geany\bin\Geany.exe" --new-instance "$*"
It works in both a DOS console and msysgit.
I've had difficulty getting Git to cooperate with WordPad, Komodo Edit and pretty much every other editor I give it. Most open for editing, but Git clearly doesn't wait for the save/close to happen.
As a crutch, I've just been doing i.e.
git commit -m "Fixed the LoadAll method"
to keep things moving. It tends to keep my commit messages a little shorter than they probably should be, but clearly there's some work to be done on the Windows version of Git.
The GitGUI also isn't that bad. It takes a little bit of orientation, but after that, it works fairly well.
I prefer to use Emacs. Getting it set up can be a little tricky.
c:\emacs
.c:\emacs\bin\addpm.exe
. You need to right-click and "Run as Administrator" if you are using Windows Vista or above. This will put the executables in your path.(server-start)
somewhere in your .emacs
file. See the Emacs Windows FAQ for advice on where to put your .emacs
file.git config --global core.editor emacsclientw
Git will now open files within an existing Emacs process. You will have to run that existing process manually from c:\emacs\bin\runemacs.exe
.
Edit .gitconfig file in c:\Users\YourUser folder and add:
[core]
editor = 'C:\\Program files\\path\\to\\editor.exe'