码迷,mamicode.com
首页 > Windows程序 > 详细

解决Windows版Git出现templates not found的问题

时间:2016-12-19 13:30:38      阅读:2136      评论:0      收藏:0      [点我收藏+]

标签:use   ted   template   scm   href   环境   sso   replace   文件夹   

环境:

 

  • Win10 x64
  • Git windows客户端(下载自 https://git-scm.com/)
  • SourceTree 1.9.6.1(使用系统安装的Git,而非SourceTree内嵌的Git)

 

问题:

今天再clone 源码时,出现一个警告信息“warning: templates not found C:\Program Files\Git\share\git-core\templates”。于是想办法解决一下。

 

分析:

看提示是没有找到tamplate文件。按照错误提示中的路径去找,确实没有对应的目录。我的Git安装目录下只有这些文件夹:

技术分享

于是搜索了一下templates目录,原来它在C:\Program Files\Git\mingw64\share\git-core\templates 这个位置。

原因找到了:原来SourceTree去了一个错误的位置找template文件,当然找不到了。我们把正确的位置告诉它就好了。

解决办法

1. 在SourceTree的设置页面找遍了也没找到设置template的地方。于是想办法直接修改配置文件。

2. 由于SourceTree是调用了Git,于是我们去修改Git的配置文件。

3. 在WIn10系统,Git的配置文件位于C:\Users\<登录用户名>\.gitconfig。使用文本编辑工具打开并加入如下几行:

[init]  

     templatedir=C:/Program Files/Git/mingw64/share/git-core/templates  

 

解决Windows版Git出现templates not found的问题

标签:use   ted   template   scm   href   环境   sso   replace   文件夹   

原文地址:http://www.cnblogs.com/lucktian/p/6196877.html

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!