Home Download Buy Blog Forum Support

How to use Sublime Text as Git commit message editor?

How to use Sublime Text as Git commit message editor?

Postby Grepsy on Fri Sep 30, 2011 12:57 pm

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?
Grepsy
 
Posts: 5
Joined: Fri Oct 15, 2010 2:09 pm


Re: How to use Sublime Text as Git commit message editor?

Postby Grepsy on Fri Sep 30, 2011 2:02 pm

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

[..] will trigger a new instance of notepad++ (hence the -multiInst' option), and wait for that instance to be closed before going on.


Right now, ST opens the file but returns control, it should somehow wait. What we need is something like http://www.sublimetext.com/docs/2/osx_command_line.html for windows. Especially the -w option.
Grepsy
 
Posts: 5
Joined: Fri Oct 15, 2010 2:09 pm

Re: How to use Sublime Text as Git commit message editor?

Postby Grepsy on Fri Sep 30, 2011 2:07 pm

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

Code: Select all
editor = "c:/Home/Tools/sublime/sublime_text.exe --wait"
Grepsy
 
Posts: 5
Joined: Fri Oct 15, 2010 2:09 pm

Re: How to use Sublime Text as Git commit message editor?

Postby jps on Fri Sep 30, 2011 2:09 pm

--wait is supported on OS X and Linux at the moment, but not yet on Windows
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: How to use Sublime Text as Git commit message editor?

Postby atomi on Fri Sep 30, 2011 5:18 pm

+1 for the --wait feature
atomi
 
Posts: 342
Joined: Thu Jan 20, 2011 5:06 pm
Location: Los Angeles CA US

Re: How to use Sublime Text as Git commit message editor?

Postby rchl on Sat Oct 01, 2011 2:07 pm

There is a workaround that involves opening new window - viewtopic.php?f=3&t=2279
rchl
 
Posts: 148
Joined: Fri Mar 04, 2011 11:02 pm

Re: How to use Sublime Text as Git commit message editor?

Postby wamatt on Mon May 21, 2012 9:47 am

How do I do it on OSX?

I tried
Code: Select all
config --global core.editor subl


Which sorta works, but then give me this error.

Code: Select all
Aborting commit due to empty commit message.
wamatt
 
Posts: 17
Joined: Mon Mar 26, 2012 9:59 am

Re: How to use Sublime Text as Git commit message editor?

Postby quarnster on Mon May 21, 2012 10:19 am

I have
Code: Select all
export EDITOR="subl -w"
in my ~/.bash_profile

wamatt wrote:How do I do it on OSX?

I tried
Code: Select all
config --global core.editor subl


Which sorta works, but then give me this error.

Code: Select all
Aborting commit due to empty commit message.
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: How to use Sublime Text as Git commit message editor?

Postby rchl on Wed May 23, 2012 6:51 pm

--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).
rchl
 
Posts: 148
Joined: Fri Mar 04, 2011 11:02 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 32 guests