git同步遇到报错

“fatal: unable to access ‘https://github.com/ruanwenwu/newp.git/‘: Peer reports incompatible or unsupported protocol version.”

网上很多人说是因为git版本需要升级。我将git版本升级到最新的2.16版本,

git的升级:

CentOS 上的最新git版本也只有1.8.3,就想试着装上最新的版本,没想到差点玩脱,全当记录一次冒险经历

  • Development tools 没装的要装上,不然GCC编译时会出错
# yum -y groupinstall Development tools
  • GCC 用于编译安装包
# yum install gcc perl-ExtUtils-MakeMaker
  • 再卸载CentOS自带的老版本git
# yum -y remove git

下载git并安装

# cd /usr/src
# wget https://www.kernel.org/pub/software/scm/git/git-2.12.0.tar.gz
# tar xzf git-2.12.0.tar.gz

安装注意事项:

# cd git-2.12.0
# make prefix=/usr/local/git all

此时报错

/usr/src/git-2.12.0/utf8.c:463:对‘libiconv’未定义的引用
libgit.a(utf8.o):在函数‘reencode_string_len’中:
/usr/src/git-2.12.0/utf8.c:524:对‘libiconv_open’未定义的引用
/usr/src/git-2.12.0/utf8.c:535:对‘libiconv_close’未定义的引用
/usr/src/git-2.12.0/utf8.c:529:对‘libiconv_open’未定义的引用
collect2: 错误:ld 返回 1
make: *** [git-credential-store] 错误 1

原方案:

# make prefix=/usr/local/git all
# make prefix=/usr/local/git install

解决方案:

可替换为

# ./configure --without-iconv
# make CFLAGS=-liconv prefix=/usr/local/git all
# make CFLAGS=-liconv prefix=/usr/local/git install

最后将git加入环境变量

# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc
在/etc/profile里加入
export PATH=$PATH:/usr/libexec/git-core
source /etc/profile

[root@iZ25lzba47vZ tp5test]# git --version
git version 2.12.0

问题却依然存在。最后更新了一下nss 问题解决了

最后:

yum update -y nss curl libcurl

问题解决了。

git同步遇到报错的更多相关文章

  1. git同步遇到报错“fatal: unable to access 'https://github.com/lizhong24/mysite2.git/': Peer reports incompatible or unsupported protocol version.”

    git同步遇到报错“fatal: unable to access 'https://github.com/lizhong24/mysite2.git/': Peer reports incompat ...

  2. 在使用 Git pull 时候报错 error: inflate

    在使用 Git pull 时候报错 error: inflate 具体的错误是 这样的 error: inflate: data stream error (unknown compression m ...

  3. git https 请求报错 504

    git https 请求报错 504 原因可能是因为设置了代理,ubuntu/deepin 系统可以检查 /etc/profile ~/.bashrc 内有没有设置 https 的代理. 有的话,去掉 ...

  4. git切换分支报错:error: pathspec 'origin/XXX' did not match any file(s) known to git

    项目上有一个分支test,使用git branch -a看不到该远程分支,直接使用命令git checkout test报错如下: error: pathspec 'origin/test' did ...

  5. git提交代码报错 trailing whitespace的解决方法

    1. git提交代码报错 trailing whitespace 禁止执行pre-commit脚本 进入到项目目录中 chmod a-x .git/hooks/pre-commit 2.git提交代码 ...

  6. mysql5.7同步复制报错1060故障处理

    mysql5.7同步复制报错故障处理 # 报错 1060,具体如下Last_Errno: 1060Last_Error: Coordinator stopped because there were ...

  7. GG同步sqlserver报错一个案例 Invalid date format

    在里面Oracle表同步sqlserver时间,在sqlserver当应用程序数据的结束.您可能会遇到这个错误. 2014-05-17 17:20:24 WARNING OGG-01154 SQL e ...

  8. Git提交代码报错Git push error:src refspec XXX matches more than one解决方案

    Git提交代码push时,报错这个 error: src refspec master matches more than one. error: failed to push some refs t ...

  9. git statsh命令报错解决

    git stash命令主要用于当在一个分支的开发工作未完成,却又要切换到另外一个分支进行开发的时候,除了commit原分支的代码改动的方法外,提供暂存代码的方式. git stash命令参考这篇:ht ...

随机推荐

  1. hadoop hdfs 数据迁移到其他集群

    # hadoop fs -cat /srclist Warning: $HADOOP_HOME is deprecated. hdfs://sht-sgmhadoopcm-01:9011/jdk-6u ...

  2. 【IDEA填坑】xml不编译

    今天在maven编译Springboot项目的时候,发现src/main/resources下的配置文件编译失败(就是war包中没有放入xml配置文件导致程序启动失败),经查询资料,发现新版本的IDE ...

  3. docker容器自动化部署(一)

    1.docker容器暴露多个端口 To expose just one port, this is what you need to do: docker run -p <host_port&g ...

  4. 关于noip2017的感想

    关于noip2017的感想 晚自习没有事做,也不知道该干什么. 第一次参加noip提高组. 前2年参加普及还算不错,没有犯任何错误. 去年就做了几套历年真题,感觉500+很好拿呀. 但去年的时候看20 ...

  5. day 09初始函数

    # with open('小护士班主任',encoding='utf-8') as f,open ('小护士班主任.bak','w',encoding='utf-8')as f2: # for lin ...

  6. 前端必备之Node+mysql+ejs模版如何写接口

    前端必备之Node+mysql+ejs模版如何写接口 这星期公司要做一个视频的后台管理系统, 让我用Node+mysql+ejs配合写接口, 周末在家研究了一下, 趁还没来具体需求把研究内容在这里分享 ...

  7. Jsoup解析获取品花社图片

    Jsoup解析获取品花社图片 emmmm,闲着没事,想起了之前一个学长做的品花社的APP,刚好之前有了解Jsoup这个Java解析HTML的库,便花了三四个小时写了这个东西,把网站上大大小小的MM的图 ...

  8. 用户认证:基于jwt和session的区别和优缺点

    背景知识: Authentication和Authorization的区别: Authentication:用户认证,指的是验证用户的身份,例如你希望以小A的身份登录,那么应用程序需要通过用户名和密码 ...

  9. Windows Server 2008 R2 服务器系统安装及配置全过程图文详解

    前言 本文主要介绍了 windows Server 2008 R2 服务器系统的安装及相关配置. 介绍的是以优盘的方式安装. 写这篇博文的目的一来是为了供有需要的网友参考, 二来自己也在此做个记载. ...

  10. python机器可读数据-XML

    XML XML是一门标记语言.也就是说,它具有包含格式化数据的文档结构. XML文档本质上只是格式特殊的数据文件. 在XML文件中有两个位置可以保存数据值:2个标签之间,标签的属性. 导入XML数据 ...