使用 "--add" 或 "--replace-all" 在 Git Bash 中更改 core.editor



我想我在 Git 中配置编辑器时出错了。我尝试重新配置,但收到此警告和错误

warning: core.editor has multiple values
error: cannot overwrite multiple values with a single value
       Use a regexp, --add or --replace-all to change core.editor.

如何使用 --add--replace-all 在 Git Bash 中更改core.editor?我正在使用Sublime Text。

错误消息建议解决方案。如果您阅读 git-config 手册页,您会看到:

git config [<file-option>] [type] --replace-all name value [value_regex]
[...]
   --replace-all
       Default behavior is to replace at most one line. This replaces all lines
       matching the key (and optionally the value_regex).

所以:

git config --replace-all core.editor myeditor

最新更新