Sublime Forum

How to use Sublime Text as Git commit message editor?

#1

I’d like to use Sublime Text as the editor for Git commit messages. This seems to be taken care of for OSX. But how can I do this for Windows?

0 Likes

#2

stackoverflow.com/questions/1056 … on-windows

0 Likes

#3

Yeah, I have that, but how do we translate the following to ST?

Right now, ST opens the file but returns control, it should somehow wait. What we need is something like sublimetext.com/docs/2/osx_command_line.html for windows. Especially the -w option.

0 Likes

#4

Hm, --wait seems to work in Windows from the command line. When I use the following gitconfig it opens a file called @* :confused:

editor = "c:/Home/Tools/sublime/sublime_text.exe --wait"
0 Likes

#5

–wait is supported on OS X and Linux at the moment, but not yet on Windows

0 Likes

#6

+1 for the --wait feature

0 Likes

#7

There is a workaround that involves opening new window - --wait command line option on Windows?

0 Likes

#8

How do I do it on OSX?

I tried

config --global core.editor subl

Which sorta works, but then give me this error.

Aborting commit due to empty commit message.
0 Likes

#9

I have export EDITOR="subl -w" in my ~/.bash_profile

[quote=“wamatt”]How do I do it on OSX?

I tried

config --global core.editor subl

Which sorta works, but then give me this error.

Aborting commit due to empty commit message.
0 Likes

#10

–wait flag is already supported on Windows. Will wait for a tab/file to be closed before returning control to the terminal (though it won’t work with Windows cmd AFAIR).

0 Likes