在使用git pull、git push、git clone的时候,或者在使用jenkins发版的时候,可能会报类似如下的错误:
error: The requested URL returned error: 401 Unauthorized while accessing https://git.oschina.net/zemo/demo.git/info/refs
fatal: HTTP request failed
像centos7.5一般自带的git都是1.8.3.1版本的,比较老了,所以有时候需要升级一下git版本
[root@localhost test1]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
[root@localhost test1]# yum install gcc perl-ExtUtils-MakeMaker
[root@localhost test1]# git --version
[root@localhost test1]# rpm -e --nodeps git
[root@localhost test1]# cd /usr/local/src/
[root@localhost test1]# wget https://www.kernel.org/pub/software/scm/git/git-2.15.1.tar.xz
[root@localhost test1]# tar -vxf git-2.15.1.tar.xz
[root@localhost test1]# cd git-2.15.1
[root@localhost test1]# make prefix=/usr/local/git all
[root@localhost test1]# make prefix=/usr/local/git install
[root@localhost test1]# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
[root@localhost test1]# source /etc/profile
[root@localhost test1]# git --version
报错,SSL连接错误
Centos系统此时更新NSS即可:
yum -y update nss
报错2,无法找到原git路径的错误
解决方法:
ln -s /usr/local/git/bin/git /usr/bin/git
参考文章:
本文由 新逸Cary 创作,如果您觉得本文不错,请随意赞赏
采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
原文链接:https://blog.xinac.cn/archives/git-update.html
最后更新:2020-05-20 10:58:40
Update your browser to view this website correctly. Update my browser now