最新消息:20210917 已从crifan.com换到crifan.org

【已解决】git下载出错:warning templates not found /usr/local/git/share/git-core/templates

Git crifan 6210浏览 0评论

mac中用sourcetree下载clone代码,结果出错:

git -c filter.lfs.smudge= -c filter.lfs.required=false -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree clone https://git.oschina.net/saicgroup/saicgroup_srt-ios.git /Users/minglong/saicgroup_srt-ios
Cloning into ‘/Users/minglong/saicgroup_srt-ios’…
warning: templates not found /usr/local/git/share/git-core/templates
error: RPC failed; HTTP 504 curl 22 The requested URL returned error: 504 Gateway Time-out
fatal: The remote end hung up unexpectedly
Completed with errors, see above

搜:

warning: templates not found /usr/local/git/share/git-core/templates

参考:

Mac SourceTree 找不到目录 – 倾盆大雨的个人空间

结果:

‍‍open‍‍ /usr/local/

根本就不工作。

然后另外去cd到对应的目录下:

/usr/local/

的确是没有git文件夹的。

本来打算要去参考该帖子,去:

http://git-scm.com/download/mac

去下载git的。

但是此处去:

git –version

看了看版本是2.8左右的版本,所以应该也够用,不影响的。

所以又去参考:

git 出现templates没有找到解决方案 – 简书

去创建对应的目录,然后再去赋值权限:

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

然后就可以解决问题了。

【总结】

此处是实际上已经安装了git,只不过版本不是最新。

但是/usr/local/下没有对应的git文件夹

(更没有 /usr/local/git/share/git-core/templates 了)

所以去创建对应文件夹,并赋值权限

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

即可解决问题。

转载请注明:在路上 » 【已解决】git下载出错:warning templates not found /usr/local/git/share/git-core/templates

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
100 queries in 0.188 seconds, using 23.33MB memory