阅读(4742) (0)

GitHub 关联文本编辑器与 Git

2020-08-19 14:41:06 更新

使用文本编辑器打开文件并通过 Git 编辑。

使用 Atom 作为编辑器

  1. 安装 Atom。 更多信息请参阅 Atom 文档中的“安装 Atom”。

  1. 输入此命令:

   $ git config --global core.editor "atom --wait"

使用 Visual Studio Code 作为编辑器

  1. 安装 Visual Studio Code (VS Code)。 更多信息请参阅 VS Code 文档中的“设置 Visual Studio Code”。

  1. 打开 Git Bash。

  1. 输入此命令:

   $ git config --global core.editor "code --wait"

使用 Sublime Text 作为编辑器

  1. 安装 Sublime Text。 更多信息请参阅 Sublime Text 文档中的“安装”。

  1. 打开 Git Bash。

  1. 输入此命令:

   $ git config --global core.editor "'C:/Program Files (x86)/sublime text 3/subl.exe' -w"

使用 Notepad++ 作为编辑器

  1. https://notepad-plus-plus.org/ 安装 Notepad++。 更多信息请参阅 Notepad++ 文档中的“入门指南”。

  1. 打开 Git Bash。

  1. 输入此命令:

   $ git config --global core.editor "'C:/Program Files (x86)/Notepad++/notepad++.exe' -multiInst -notabbar -nosession -noPlugin"