Git - 为什么我收到错误 "subl -n -w: subl: command not found"?

标签 git

每次我将 dev 分支与我的本地分支 merge 时,我都会收到以下错误:

subl -n -w: subl: command not found
error: There was a problem with the editor 'subl -n -w'.
Not committing merge; use 'git commit' to complete the merge

即使 Sublime Text 关闭,我也会收到此错误,但我不确定它是否在提示 Sublime。有谁知道如何避免或修复此错误?

最佳答案

您的 git 编辑器配置不正确。配置 git 编辑器时必须提供完整路径。

对于 Sublime text 3 使用以下命令-

git config --global core.editor " 'C:/Program Files/Sublime Text 3/subl' -n -w"

如果您有 Sublime text 2,请使用以下命令-

git config --global core.editor " 'C:/program files/sublime text2/sublime_text.exe' -n -w" 

关于Git - 为什么我收到错误 "subl -n -w: subl: command not found"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31186227/

相关文章:

linux - 我无法克隆 git 树

git - 如何获取整个 git 历史的文件夹大小

git - git repo 的奇怪问题?

git - 如何更改我在 GitHub 上的作者姓名?

git - 为什么 'git stash apply' 会暂存我的更改?

Git 存储库向后兼容性

预提交钩子(Hook)中的 git clone 导致钩子(Hook)失败

git - cherry-pick - HOWTO/WHYTO

python - pip 在未安装 git 时尝试使用 git

Git:终端上的 "[master $=]"是什么意思?