问题:

Mac下,sourcetree克隆代码报错:warning templates not found /usr/local/git/share/git-core/templates

网上搜相关问题,有的说:下载 git-osx
并安装,http://git-scm.com/download/mac,然鹅下载没反应,遂放弃。

解决方案:

1、终端输入:open /usr/local/,查看该目录发现没有git文件夹;

2、创建对应文件夹,并赋值权限(依次输入如下命令):

  1. sudo mkdir -p /usr/local/git/share/git-core/templates
  1. sudo chmod -R 755 /usr/local/git/share/git-core/templates

3、再次克隆,成功。

拓展:

查看git版本:git --version
查看git地址:which git