SourceTree克隆代码报错_Mac:warning templates not found _usr_local_git_share_git core_templates

935 阅读1分钟

问题:

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

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

解决方案:

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

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

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

3、再次克隆,成功。

拓展:

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