参考资料:
https://help.github.com/articles/associating-text-editors-with-git/
https://stackoverflow.com/questions/8951275/how-can-i-make-sublime-text-the-default-editor-for-git
======================================================
写道
Using Atom as your editor
You can set your default editor in Git to use Atom if you have installed the editor.
1、Install Atom.
Open Terminal.
Type this command:
$ git config --global core.editor "atom --wait"
2、Using Sublime Text as your editor
You can set your default editor in Git to use Sublime Text 3.
Install Sublime Text 3.
Open Terminal.
Type this command:
$ git config --global core.editor "subl -n -w"
3、Using TextMate as your editor
You can set your default editor in Git to use Textmate if you have installed the mate command.
Install mate
Open Terminal.
Type this command:
$ git config --global core.editor "mate -w"
You can set your default editor in Git to use Atom if you have installed the editor.
1、Install Atom.
Open Terminal.
Type this command:
$ git config --global core.editor "atom --wait"
2、Using Sublime Text as your editor
You can set your default editor in Git to use Sublime Text 3.
Install Sublime Text 3.
Open Terminal.
Type this command:
$ git config --global core.editor "subl -n -w"
3、Using TextMate as your editor
You can set your default editor in Git to use Textmate if you have installed the mate command.
Install mate
Open Terminal.
Type this command:
$ git config --global core.editor "mate -w"
======================================================
我设置 sublime text3 为自己的 git 提交编辑器。如下:
Mac 的设置 写道
git config --global core.editor "'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl' -n -w"
这里的 sublime text3 的目录需要自己来根据情况来修改。其实就是找到sublime text3的安装目录,找到它的运行程序,将这个完整的运行程序的目录写在这里。