git associated editor software (sublime)

References: 

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

======================================================

wrote
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"

 

 

======================================================

I'm setting up sublime text3 as my git commit editor. as follows:

Mac's settings says

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

 The directory of sublime text3 here needs to be modified according to the situation. In fact, it is to find the installation directory of sublime text3, find its running program, and write the directory of the complete running program here.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326394667&siteId=291194637