[SourceTree] - 使用内置 Git 克隆项目出现 templates not found 问题之解决

背景

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

错误

warning: templates not found C:\Program Files\Git\share\git-core\templates.

原因

SourceTree 寻找 template 文件的路径不对,正确路径应该为 C:\Program Files\Git\mingw64\share\git-core\templates

解决

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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值