2

On a windows machine.

I have run git:

config --global core.editor "[path to sublime_text.exe] -w" 

and sublime text does in fact open when I make commit, however instead of opening the relevant COMMIT_EDITMSG it opens up a new blank tab titled "$@". I then have to open up the correct COMMIT_EDITMSG within sublime text before saving it.

I am hoping there is a way to set up git with sublime text 3 so that I can skip the manual navigation and the relevant COMMIT_EDITMSG opens whenever I run git commit.

Opal
  • 81,889
  • 28
  • 189
  • 210
Jay Moontra
  • 143
  • 1
  • 7
  • Would adding the -n option help? (as in http://stackoverflow.com/a/25255676/6309) – VonC Jun 09 '15 at 07:24
  • Did you install cmdline features in sublime? – Nick Volynkin Jun 09 '15 at 14:30
  • @VonC My original command included -n but that didn't seem to help either, it just opened a second blank window in sublime also titled "$@". – Jay Moontra Jun 10 '15 at 02:03
  • @NickVolynkin I just read over the command line features in sublime here: http://www.sublimetext.com/docs/command-line but I am not able to see how this will help me with my problem. Care to elaborate? – Jay Moontra Jun 10 '15 at 02:03
  • @JayMoontra instead of calling directly `sublime_ext.exe`, could you try (as I did in http://stackoverflow.com/a/30443796/6309) `start "Sublime Text 3" "C:\path\to\Sublime_Text_x64\sublime_text.exe -n -w"` (with or without the `-n`) – VonC Jun 10 '15 at 09:19

1 Answers1

1

You could install the GitSavvy plugin for SublimeText3 - you can then do all this inside sublime - with lots of other benefits, too.

Duncan Lock
  • 12,351
  • 5
  • 40
  • 47