I'm trying to use Sublime Text 3 as Git's editor.

I ran this:

sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

Then this:

git config --global core.editor "subl -n -w"

I then ran:

git commit --amend

Sublime opened and I edited the file, saved it, and then closed it. However, Git was still waiting for the file to close:

hint: Waiting for your editor to close the file...
  • There is no error message.
  • I can use Sublime with no problems outside of Git.
  • I tried restarting the machine (MacBook Pro).
  • Using textedit works as expected: git config --global core.editor "open -W -n"
  • The version of Sublime is: 3.2.1 Build 3207
  • Git: git version 2.17.1 (Apple Git-112)

Why isn't this working?

  • stackoverflow.com/questions/40376335/… This comment(year 2016) here by a similar problem says that all of sublime needs to be quit, not only that file, despite -w -n being used. This sure poses a problem with those using the app for the project also. I use textedit. – ankii Sep 19 at 18:46
  • stackoverflow.com/questions/50184996/git-editor-commit-error/… Actually there are some more questions and answer for the same on SO too. stackoverflow.com/questions/8951275/… – ankii Sep 19 at 18:51
  • 1
    @ankii I already use Cmd+Q to quit the editor, so unfortunately that doesn't help. The first link (using just -w) doesn't help, and I've already tried the second. Colleagues with the exact same Sublime version got it to work, so there's something really weird going on on my machine... – Mitch Sep 20 at 6:31

You must log in to answer this question.

Browse other questions tagged .