环境:
- Win10 x64
- Git windows客户端
- SourceTree 2.4.8.0
问题:
今天再clone 源码时,出现一个警告信息“warning: templates not found C:\Program Files\Git\share\git-core\templates”。
按照提示给出的路径去查找确实没有查找到该路径。然后在Git文件夹下查找templates,发现实际目录为D:\Git\installation\Git\mingw64\share\git-core\templates
因此要在git中重新设置一下templated选项,具体设置方法有两种:
1.使用git命令去设置
在命令行中输入以下命令
git config --global init.templatedir D:/Git/installation/Git/mingw64/share/git-core/templates
注意:这里应用的是“/”
2.在git配置文件中修改
一般git时会生成一个C:\Users\<登录用户名>.gitconfig文件。在该文件中加入以下代码
[init]
templatedir=D:/Git/installation/Git/mingw64/share/git-core/templates
注意:[init]不能缺少,这里应用的是“/”
设置完后重启SourceTree。
我使用的是第一种方法,第二种没试。