重置 git 模板路径
Reset git template path
我正在尝试将 git 模板路径设置为:
– git config --global commit.template <path to 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 只是文件夹,我忘了提到文件名
下次执行时:
任何指向我的查询的指针都将不胜感激。
您可以使用以下方法删除它:
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
我正在尝试将 git 模板路径设置为:
– git config --global commit.template <path to 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 只是文件夹,我忘了提到文件名
下次执行时:
任何指向我的查询的指针都将不胜感激。
您可以使用以下方法删除它:
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