ram*_*aLi 2 git git-bash macos-high-sierra
我已经配置了我的核心编辑器,一切正常。我可以在我的编辑器中从命令行打开任何文件。
但是,当我到达 'git commit' 时,我收到了这个错误:
hint: Waiting for your editor to close the file... fatal: cannot run --
unset-all: No such file or directory
error: unable to start editor '--unset-all'
Please supply the message using either -m or -F option.
Run Code Online (Sandbox Code Playgroud)
我首先尝试使用 Sublime,而不是 Brackets 和 Atom。我什至尝试重置 .gitconfig ( rm ~/.gitconfig) 并且没有任何改变。
有什么命令可以修复这个错误吗?还是我必须卸载git?
正如@MarkAdelsberger 所注意到的,您似乎已将编辑器设置为--unset-all. 也许您混淆了参数的顺序并调用了git config --global core.editor --unset-all? 那会导致你描述的情况。
Git 具有三个级别的设置:全局、系统和本地(存储库)。删除~/.gitconfig只会摆脱全局设置,所以也许你在某个地方搞砸了并在另一个级别更改了编辑器配置。您可以尝试使用正确的语法重置所有级别的编辑器设置:
git config --global --unset-all core.editor
git config --system --unset-all core.editor
git config --unset-all core.editor
Run Code Online (Sandbox Code Playgroud)
这应该重置为默认编辑器。
| 归档时间: |
|
| 查看次数: |
3566 次 |
| 最近记录: |