簡體   English   中英

如何使用 git 提交打開 Sublime Text 3 編輯器

[英]How to open Sublime Text 3 editor with git commit

我已經將 Sublime Text 3 配置為 git Bash 的文本編輯器。當我鍵入subl 'filePath'時,Sublime 成功打開

但是,當我嘗試 git 提交時,文本編輯器無法打開並輸出以下錯誤:

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 中設置默認編輯器以使用 Sublime Text 3。

  1. 安裝 Sublime Text 3。

  2. 打開 Git Bash。

  3. 鍵入此命令:

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

我在Mac上使用了以下命令並且它有效

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM