sudo yum install git
git --version
to make sure it’s installed.
Make sure you have sudo access.
sudo yum groupinstall "Development Tools"
CentOS 6.x
sudo yum install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel
CentOS 7.x
sudo yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
wget https://github.com/git/git/archive/v2.2.2.tar.gz -O git.tar.gz
Check Github Release page for the latest stable version. Or install teh latest -rc
(release candidate) version if you are feeling dangerous. Latest stable is recommended.
tar -zxf git.tar.gz && cd git-*
make configure
./configure --prefix=/usr/local
sudo make install
git --version
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
To confirm that these configurations were added successfully, we can see all of the configuration items that have been set by typing:
git config --list
user.name=Your Name
user.email=you@example.com