[SourceTree]

背景

使用 SourceTree 克隆 Asp.Net Core 项目失败。

错误

warning: templates not found C:Program FilesGitsharegit-core emplates.

原因

SourceTree 寻找 template 文件的路径不对,正确路径应该为 C:Program FilesGitmingw64sharegit-core emplates

解决

1. 在 SourceTree 的设置选项中没找到设置 template 的地方,于是想办法直接修改配置文件。

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

原文地址:https://www.cnblogs.com/jinzesudawei/p/8647407.html