Under Linux (CentOS/RHEL 7/6/5), install the latest version 2.10.2 of Git as source code (transfer)

I log in directly here as ROOT. If the current account is not the root account, please add sudo in front of the command

1. Dependencies required to install Git
# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
# yum install gcc perl-ExtUtils-MakeMaker

2. Download and install Git2.10.2

# cd ~
# wget https://github.com/git/git/archive/v2.10.2.tar.gz
# tar -zxvf git-2.10.2.tar.gz


3. Compile and install Git
# cd git-2.10.2
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install

4. Add Git to the system environment variable
# vi /etc/bashrc
Add the following code to the end of the file One line:
export PATH=$PATH:/usr/local/git/bin
Save and source
#source /etc/bashrc

5. Check if the installation is successful
# git --version

git version 2.10.2


In this way, the latest version of Git is installed successfully!

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326896957&siteId=291194637