I would like to use Sublime editor for git (esp. rebase) editing operations rather than default vi editor in macOS. The following steps will help you to configure Sublime as your git editor.
Make Sublime accessible from anywhere in terminal
In Sublime 3,
subl command to invoke Sublime from terminal is located at
First we have to make this accessible from anywhere in terminal. For that, create a symbolic link to any folder that is already part of
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
This is not a necessary step. But doing above will make Sublime invokable from any folder in terminal for doing other editing operations as well.
Set Sublime as git editor
git config --global core.editor "subl -n -w"
Additional parameters do the following here:
-ntells git to open a new editor window
-wtells git to wait until the commit message is saved
This should get it working for you! Try out by running command
git rebase -i HEAD~