背景git
使用 SourceTree 克隆 Asp.Net Core 项目失败。工具
错误spa
warning: templates not found C:\Program Files\Git\share\git-core\templates..net
缘由code
SourceTree 寻找 template 文件的路径不对,正确路径应该为 C:\Program Files\Git\mingw64\share\git-core\templates 。blog
解决it
1. 在 SourceTree 的设置选项中没找到设置 template 的地方,因而想办法直接修改配置文件。class
2. 因为SourceTree是调用了内置 Git,因而咱们去修改 Git 的配置文件。登录
3. 在WIn10系统中,Git 的配置文件位于 C:\Users\<登陆用户名>\.gitconfig 。使用文本编辑工具打开并加入以下几行:配置
[init] templatedir=C:/Program Files/Git/mingw64/share/git-core/templates
注意:路径中的"\"要用"/"代替,否则会报错。
保存并重启SourceTree,问题解决。
参考资料
https://blog.csdn.net/sunux_sunux/article/details/52944807