Centos6.5 upgrade git

The built-in git version installed by the yum command in Centos6.5 is 1.7.1. In use, an error will be reported due to the low version. Use the following method to upgrade normally.

 

1. Install the required libraries for compilation

# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
# yum install  gcc perl-ExtUtils-MakeMaker

 

2. Uninstall git1.7.1 that comes with Centos

Check the version with the system through git –version, Cento6.5 should come with the git version 1.7.1

# yum remove git

 

3. Download the new version of git and compile and install

# wget https://www.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz

# tar zxvf git-2.9.0.tar.gz

# cd git-2.9.0

# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc

 

4. After the installation is complete, check the version number

# git --version
git version 2.9.0

 

5. When the remote clone always needs to enter the password, I checked it for 2 days.

Finally found the server log /var/log/secure ,

There is this hint:

Mar  9 16:41:22 iZ23pzb4tg2Z sshd[3001]: User git not allowed because shell /usr/bin/git-shell does not exist
Mar  9 16:41:22 iZ23pzb4tg2Z sshd[3002]: input_userauth_request: invalid user git
Mar  9 16:44:16 iZ23pzb4tg2Z sshd[3011]: User git not allowed because shell /usr/bin/git-shell does not exist
Mar  9 16:44:16 iZ23pzb4tg2Z sshd[3012]: input_userauth_request: invalid user git

Finally reset the git-shell path in /etc/passwd

Guess you like

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