Sublime Forum

Git rebase -i master not opening sublime

#1

I get the following error when using git rebase -i master although the subl command works to open html, css and js files.

/usr/local/Cellar/git/2.9.0/libexec/git-core/git-rebase–interactive: line 255: /Applications/Sublime: No such file or directory
Could not execute editor

which -a subl

subl () {
“$_sublime_path” $*
}

ls -al which subl

ls: “$_sublime_path”: No such file or directory
ls: $*: No such file or directory
ls: (): No such file or directory
ls: {: No such file or directory
ls: }: No such file or directory
lrwxr-xr-x 1 myusername staff 62 29 Jun 07:19 subl -> /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl

Contents of ~/.gitconfig

exludesfile = /Users/myusername/.gitignore_global
editor = /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl

0 Likes

#2

Based purely on how the error message says /Applications/Sublime: no such file or directory and not /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl: no such file or directory (i.e. it’s not displaying the full path that you have specified in the .gitconfig), I would wager that this is because of the space in the path name.

I would do something like this (tested to work for me):

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

This quotes the space in the path; additionally the -n says to open a new window (redundant on mac I think but still good form) and the -w tells it to wait for files to be closed before returning back. I don’t use sublime for git editing from the command line (I prefer vim) so I don’t know offhand if it plays nice if you don’t do that.

4 Likes

#3

It worked! You are a legend. I have had this problem for a couple of weeks. Thanks mate.

1 Like