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 the terminal
In macOS, subl
command that can be used to invoke Sublime (version 3) from the terminal is located at
/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl
First we have to make this accessible from anywhere in the terminal. For that, create a symbolic link to any folder that is already part of PATH
variable
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
Set Sublime as git editor
git config --global core.editor "subl -n -w"
Additional parameters do the following here:
-n
tells git to open a new editor window-w
tells git to wait until the commit message is saved
This should get it working for you! Try out by running the command
git rebase -i HEAD~