我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们

此版本的 GitHub Enterprise 将停止服务 此版本的 GitHub Enterprise 已停止服务 2020-01-22. 即使针对重大安全问题,也不会发布补丁。 要获得更好的性能、改进的安全性和新功能,请升级到 GitHub Enterprise 的最新版本。 如需升级方面的帮助,请联系 GitHub Enterprise 支持

关联文本编辑器与 Git

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

本文内容

使用 Atom 作为编辑器

如果已安装相关编辑器,您可以在 Git 设置默认编辑器使用 Atom。

  1. 安装 Atom。

  2. 打开 Terminal(终端)Terminal(终端)Git Bash

  3. 输入此命令:

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

使用 Sublime Text 作为编辑器

您可以在 Git 中设置默认编辑器使用 Sublime Text 3。

  1. Install Sublime Text 3.

  2. 打开 Terminal(终端)Terminal(终端)Git Bash

  3. 输入此命令:

    $ git config --global core.editor "subl -n -w"

使用 TextMate 作为编辑器

如果已安装 mate 命令,您可以在 Git 设置默认编辑器使用 Textmate。

  1. Install mate

  2. 打开 Terminal(终端)Terminal(终端)Git Bash

  3. 输入此命令:

    $ git config --global core.editor "mate -w"

使用 Atom 作为编辑器

如果已安装相关编辑器,您可以在 Git 设置默认编辑器使用 Atom。

  1. 安装 Atom。

  2. 打开 Terminal(终端)Terminal(终端)Git Bash

  3. 输入此命令:

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

使用 Sublime Text 作为编辑器

您可以在 Git 中设置默认编辑器使用 Sublime Text 3。

  1. Install Sublime Text 3.

  2. 打开 Terminal(终端)Terminal(终端)Git Bash

  3. 输入此命令:

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

使用 Notepad++ 作为编辑器

如果已安装相关编辑器,您可以在 Git 中设置默认编辑器使用 Notepad++。

  1. 安装 Notepad++。

  2. 打开 Terminal(终端)Terminal(终端)Git Bash

  3. 输入此命令:

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

使用 Atom 作为编辑器

如果已安装相关编辑器,您可以在 Git 设置默认编辑器使用 Atom。

  1. 安装 Atom。

  2. 打开 Terminal(终端)Terminal(终端)Git Bash

  3. 输入此命令:

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

使用 Sublime Text 作为编辑器

您可以在 Git 中设置默认编辑器使用 Sublime Text 3。

  1. Install Sublime Text 3.

  2. 打开 Terminal(终端)Terminal(终端)Git Bash

  3. 输入此命令:

    $ git config --global core.editor "subl -n -w"

问问别人

找不到要找的内容?

联系我们