git synchronization encountered an error


git synchronization encountered an error

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

Many people on the Internet say that it is because the git version needs to be upgraded. I upgraded the git version to the latest 2.16 version,

git upgrade:

The latest version of git on CentOS is only 1.8.3, so I wanted to try to install the latest version, but I almost lost my mind, so I just wanted to record an adventure.

  • Development tools should be installed if they are not installed, otherwise GCC will make an error when compiling
# yum -y groupinstall Development tools
  • GCC is used to compile the installation package
# yum install gcc perl-ExtUtils-MakeMaker
  • Then uninstall the old version of git that comes with CentOS
# yum -y remove git

Download git and install

# 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

Installation Precautions:

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

Error at this time

/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

original plan:

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

solution:

     can be replaced with

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

Finally, add git to the environment variable

# 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 The

problem still exists. Finally updated the nss problem solved

Finally:

yum update -y nss curl libcurl

problem solved.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325554835&siteId=291194637