解决办法:

在安装git时没有默认安装到c盘,而是安装到了d盘。在使用SourceTree进行代码克隆时提示warning: templates not found in D:\software\development\Git\share\git-core\ 按照提示给出的路径去查找确实没有查找到该路径。然后在Git文件夹下查找templates,发现实际目录为D:\Program Files\Git\mingw64\share\git-core\templates。因此要在git中重新设置一下templated选项,具体设置方法有两种:

使用git命令去设置
在命令行中输入以下命令 设为你本地的git仓库目录,比如我想使用 D:\work\wfkj\project\gitrepo 这个目录作为我本地的git仓库,那么运行下面的命令或者修改 配置文件

git config --global init.templatedir D:/work/wfkj/project/gitrepo

这里注意应用的是“/”

在git配置文件中修改
一般git时会生成一个C:\Users\<登录用户名>.gitconfig文件。在该文件中加入以下代码

[init]
templatedir=D:/work/wfkj/project/gitrepo

注意[init]不能缺少,并需要注意应用的是“/”
设置完后重启SourceTree。

作者:karlZh_寻易
来源:CSDN
原文:https://blog.csdn.net/zhaochengxu/article/details/78952496
版权声明:本文为博主原创文章,转载请附上博文链接!

相关文章:

  • 2021-12-29
  • 2022-01-04
  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2022-02-09
猜你喜欢
  • 2021-11-30
  • 2022-12-23
  • 2022-02-01
  • 2021-04-04
  • 2021-08-31
  • 2022-12-23
  • 2021-10-13
相关资源
相似解决方案