Search code examples
gitsublimetext3

Setting up sublimetext 3 as git commit text editor


I'm having trouble setting up sublime as my git commit message editor.

Using:

git config --global core.editor "subl"

Error: error: cannot run subl: No such file or directory error: unable to start editor 'subl' Please supply the message using either -m or -F option.

subl work perfectly otherwise.


Solution

  • You can solve this by putting in a full path

    git config --global core.editor "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n -w"
    

    Source: OS X Command Line

    EDIT: If the name of the app is not Sublime Text.app you will want to replace that with the correct name.