There is no git in Yum in CentOS and requires manual installation.
First you need to install a git dependency package
Shell Code
- Yum Install Curl
- Yum Install Curl-devel
- Yum Install Zlib-devel
- Yum Install Openssl-devel
- Yum Install Perl
- Yum Install Cpio
- Yum Install Expat-devel
- Yum Install Gettext-devel
Download the latest Git package
Shell Code
- wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
- Tar xzvf git-latest.tar.gz
- #进入git源码目录, the last version date is different so use XXXX-XX-XX to indicate
- #可以使用 "Ll-a" Look at the directory name and change it to the corresponding directory name (the date is different)
- CD GIT-XXXX-XX-XX
- Autoconf
- ./configure
- Make
- Make install
To verify that the installation was successful: Check the installed version
Shell Code
- Git--version
Add User git
Shell Code
- sudo useradd-r-s/bin/sh-c ' git version control '-d/home/git git
Set permissions
Shell Code
- Mkdir-p/home/git
- Chown Git:git/home/git
Add git under CentOS