Search code examples
gitsublimetext3git-commit

How to open Sublime Text 3 editor with git commit


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.


Solution

  • 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"