【发布时间】:2021-04-05 08:09:41
【问题描述】:
Git 正在读取一个陈旧的模板路径。这条路径曾经在我的旧 VM 中。我已将这个 git 目录原样复制到一个新的虚拟机中。
我尝试从~/.gitconfig 中删除“[commit] 模板”条目,然后是git commit,但它仍然给我这个错误。
然后我尝试删除所有条目,但无济于事。
$ git config --global --unset-all commit.template
$ git commit
fatal: could not read '/home/subtleseeker/main/commit-template.txt': No such file or directory
知道吗,git 是从哪里读取这条路径的?
$ git config --global commit.template /home/peeches/main/commit-template.txt
$ git config -l | grep template
commit.template=/home/peeches/main/commit-template.txt
commit.template=/home/subtleseeker/main/commit-template.txt
$ git config --global --unset-all commit.template
$ git config -l | grep template
commit.template=/home/subtleseeker/main/commit-template.txt
Git 版本:git version 2.30.1
操作系统:CentOS Linux release 7.9.2009 (Core)
【问题讨论】:
标签: git