重置git模板路径

KOT*_*IOS 2 git github

我正在尝试将git模板路径设置为:

– git config --global commit.template  <path to template>
Run Code Online (Sandbox Code Playgroud)

对于第一次尝试,我输入了错误的路径,并且无法再次重置该路径,但出现以下错误:

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.
Run Code Online (Sandbox Code Playgroud)

因此,我无能为力git commit

编辑:

最初我执行了:

– git config --global commit.template  E:/mygit
Run Code Online (Sandbox Code Playgroud)

我的git只是文件夹,我忘了提及文件名

下次我执行:

在此处输入图片说明

任何指向我的查询的指针将不胜感激。

nwi*_*ler 5

您可以使用以下方法将其删除:

git config --global --unset-all commit.template
Run Code Online (Sandbox Code Playgroud)

我不确定您如何最终在其中包含多个值。当我调用时git config commit.template foo.txt,它将覆盖先前的值。

我可以重现您问题的唯一方法是使用git config --add commit.template foo.txt,它似乎增加了第二个值。

如果您不想使用命令行,也可以使用文本编辑器编辑全局git配置文件。它可能包括如下部分:

[commit]
    template = template2.txt
    template = template.txt
Run Code Online (Sandbox Code Playgroud)