背景

goods.api需要在新机器上部署,该机器上没有安装git,需要安装git,查询git版本为2.4.5-1.el6 ,使用yum 一顿安装后,执行git clone命令告知warning: templates not found /usr/local/test-git/share/git-core/templates ,导致无法拉取代码下来

操作流程重现

1、执行 yum list | grep ^git  查看git版本
 

 

2、执行yum install git.x86_64 ,安装git

图略

3、安装完毕后 ,去到相应的目录执行git clone xxxx.git ,提示warning: templates not found /usr/local/test-git/share/git-core/templates

解决思路

1、碰到问题先baidu+bing+google

大概知道两种方案:一种指定安装路径重新安装一次git;第二方案,提示找不到templates,那就指定templates;采用第二方案,指定templates目录,资料(http://www.cnblogs.com/lucktian/p/6196877.html)显示需要指定templatedir这个变量,需要去到~/.gitconfig文件去设置

2、先获取已经安装git的templates目录

    执行rpm -ql git 查看安装路径
    

 

3、准备修改~/.gitconfig,添加templatedir的参数,结果发现没有~/.gitconfig文件,但是可以通过git config --global init.templatedir “/usr/share/git-core/templates”

    执行git config --global init.templatedir=/usr/share/git-core/templates 后发现竟然生成了.gitconfig文件,查看该文件
    

4、再执行git clone xxx.git 发现没有报错,可以正常拉取代码

 

思考

1、可能是因为之前安装了不同版本的git,没有卸载干净导致这个问题的;

2、查询的资料少的时候,结合已知信息多尝试;

3、config的设置是根据git config --global user.name "jwen" 联想过来的;

最新文章

  1. Linux安装MySQL
  2. 信頼済みサイト对window.open窗体大小影响原因之一
  3. RAW格式
  4. dp,px转换
  5. Xamarin Mono错误: unable to find explicit activity class
  6. tessnet2 在vs2010 及以上版本不能调用的解决方案
  7. BZOJ 1264 基因匹配Match(LCS转化LIS)
  8. iOS9 白名单问题 -canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
  9. 工具类总结---(六)---之http及https请求
  10. Uva 11300 Spreading the Wealth(递推,中位数)
  11. Linux C系统编程:信号与定时器的使用
  12. MacBook上那些好用的工具们
  13. [POI2012]Tour de Bajtocja
  14. python之unittest单元测试
  15. (第1篇)什么是hadoop大数据?我又为什么要写这篇文章?
  16. u3d 创建元件 预制件 U3d creates component prefabricated parts
  17. java设计模式-----17、中介者模式
  18. GLSL 内建函数
  19. 遇到Caused by: java.lang.NoClassDefFoundError: javax/validation/ParameterNameProvider
  20. VC6.0静态编译注意事项

热门文章

  1. C#调用Oracle带输出数据集的存储过程
  2. js实现的快速排序
  3. 熟悉下apple 马甲包
  4. JS在生成csv文件时,","逗号问题处理.
  5. 迷你MVVM框架 avalonjs 1.3.1发布
  6. HTTP请求出现405状态码method not allowed的解决办法
  7. react-navigation的多次点击重复跳转同一页面、不在堆栈路由页面使用navigation方法的解决思路
  8. _MainTex_TexelSize what's the meaning?
  9. UISearchDisplayController 阴影遮盖frame调整
  10. MFC The Screen Flickers When The Image Zoomed