如何使用git commit打开Sublime Text 3编辑器

问题描述 投票:1回答:1

我已经将Sublime Text 3配置为git Bash的文本编辑器。当我键入subl 'filePath'

时,Sublime成功打开

但是,当我尝试执行git commit时,文本编辑器无法打开并输出以下错误:

hint: Waiting for your editor to close the file... subl -n -w: subl: command not found
error: There was a problem with the editor 'subl -n -w'.
Please supply the message using either -m or -F option.

我已将文件添加到暂存区并准备提交。

git sublimetext3 git-commit
1个回答
0
投票

您可以尝试this

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

  1. 安装Sublime文字3。

  2. Open Git Bash。

  3. 输入此命令:

git config --global core.editor "'C:/Program Files (x86)/sublime text 3/subl.exe' -w"
© www.soinside.com 2019 - 2024. All rights reserved.