作者:久居我心入我怀 | 来源:互联网 | 2023-05-21 14:38
我正在尝试将git模板路径设置为:
– git config --global commit.template
对于第一次尝试,我输入了错误的路径,并且无法再次重置该路径,但出现以下错误:
warning: commit.template has multiple values
error: cannot overwrite multiple values with a single value
Use a regexp, --add or --replace-all to change commit.template.
因此,我无能为力git commit
。
编辑:
最初我执行了:
– git config --global commit.template E:/mygit
我的git只是文件夹,我忘了提及文件名
下次我执行:
任何指向我的查询的指针将不胜感激。
1> nwinkler..:
您可以使用以下方法将其删除:
git config --global --unset-all commit.template
我不确定您如何最终在其中包含多个值。当我调用时git config commit.template foo.txt
,它将覆盖先前的值。
我可以重现您问题的唯一方法是使用git config --add commit.template foo.txt
,它似乎增加了第二个值。
如果您不想使用命令行,也可以使用文本编辑器编辑全局git配置文件。它可能包括如下部分:
[commit]
template = template2.txt
template = template.txt