1

I have already configured Sublime Text 3 as my text editor for git Bash. Sublime successfully opens when I type subl 'filePath'

However, when I try a git commit, the text editor fails to open and outputs the following error:

hint: Waiting for your editor to close the file... subl -n -w: subl: command not found
error: There was a problem with the editor 'subl -n -w'.
Please supply the message using either -m or -F option.

I have added to files to the staging area and am ready to commit.

Danny
  • 39
  • 9
  • 2
    Does this answer your question? [How do I make Git use the editor of my choice for commits?](https://stackoverflow.com/questions/2596805/how-do-i-make-git-use-the-editor-of-my-choice-for-commits) – evolutionxbox Jan 10 '20 at 00:35
  • Does this answer your question? [How can I make Sublime Text the default editor for Git?](https://stackoverflow.com/questions/8951275/how-can-i-make-sublime-text-the-default-editor-for-git) – idleberg Jan 10 '20 at 17:49

2 Answers2

1

You can try this

You can set your default editor in Git to use Sublime Text 3.

  1. Install Sublime Text 3.

  2. Open Git Bash.

  3. Type this command:

git config --global core.editor "'C:/Program Files (x86)/sublime text 3/subl.exe' -w"
Tony Ngo
  • 19,166
  • 4
  • 38
  • 60
0

I used the below command on Mac and it worked

$ git config --global core.editor "'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl' -n -w"
Devrath
  • 42,072
  • 54
  • 195
  • 297
  • Basically identical to https://stackoverflow.com/a/47294229/341994 and other existing answers. – matt May 07 '22 at 14:23