Alan Quigley Alan Quigley - 3 months ago 19
Git Question

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.

Answer

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: OXS Commandline

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