跳至主要内容

将文本编辑器与 Git 关联

使用文本编辑器打开和编辑 Git 文件。

平台导航

使用 Visual Studio Code 作为您的编辑器

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

  2. 打开 终端终端Git Bash

  3. 键入此命令

    git config --global core.editor "code --wait"
    
  1. 安装 Visual Studio Code (VS Code)。更多信息,请参阅 VS Code 文档中的“设置 VS Code”。

  2. 打开 终端终端Git Bash

  3. 键入此命令

    git config --global core.editor "code --wait"
    
  1. 安装 Visual Studio Code (VS Code)。更多信息,请参阅 VS Code 文档中的“设置 VS Code”。

  2. 打开 终端终端Git Bash

  3. 键入此命令

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

使用 Sublime Text 作为您的编辑器

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

  2. 打开 终端终端Git Bash

  3. 键入此命令

    git config --global core.editor "subl -n -w"
    
  1. 安装Sublime Text。更多信息,请参阅Sublime Text文档中的“安装”部分。

  2. 打开 终端终端Git Bash

  3. 键入此命令

    git config --global core.editor "'C:/Program Files (x86)/sublime text 3/subl.exe' -w"
    
  1. 安装Sublime Text。更多信息,请参阅Sublime Text文档中的“安装”部分。

  2. 打开 终端终端Git Bash

  3. 键入此命令

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

使用TextMate作为您的编辑器

  1. 安装TextMate

  2. 安装TextMate的mate shell实用程序。更多信息,请参阅TextMate文档中的“matermate”部分。

  3. 打开 终端终端Git Bash

  4. 键入此命令

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

使用Notepad++作为您的编辑器

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

  2. 打开 终端终端Git Bash

  3. 键入此命令

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