brunodd brunodd - 5 days ago 5
Git Question

Git - Why am I getting the error "subl -n -w: subl: command not found"?

Everytime when I am merging dev branch with my local branch I get the following error:

subl -n -w: subl: command not found
error: There was a problem with the editor 'subl -n -w'.
Not committing merge; use 'git commit' to complete the merge


I am getting this error even when Sublime Text is closed however I am not sure if it's complaining about Sublime. Does anyone know how to avoid or fix this error?

Answer

Your git editor has not configured properly.You have to give full path while configuring your git editor.

For Sublime text 3 use following command-

git config --global core.editor " 'C:/Program Files/Sublime Text 3/subl' -n -w"

If you have Sublime text 2 use following command-

git config --global core.editor " 'C:/program files/sublime text2/sublime_text.exe' -n -w" 
Comments