Git has released 2.21 version on Feb 24, 2019. Git is a free and open source distributed version control system. It is designed to handle a small to very large projects with speed and efficiency. To read more details and changes about Git 2.21 read release notes. If you are using a Git repository for your development, then you must require a git client on your system and you need to install git client on your workstation system.
This tutorial will help you to install git 2.21 on CentOS/RHEL 7/6 and Fedora 29/28/27/26/25 operating systems using the source code. For beginners visit Git console on your browser and learn Git uses and command line tips.
Step 1 – Prerequsities
Before installing Git from source code, make sure you have already installed required packages on your system. If not use the following command to install the required packages.
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel yum install gcc perl-ExtUtils-MakeMaker
Step 2 – Install Git on CentOS & Fedora
Download latest Git source code from kernel git or simply use following command to download Git 2.21.0.
cd /usr/src wget https://www.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz tar xzf git-2.21.0.tar.gz
After downloading and extracting Git source code, Use the following command to compile the source code.
cd git-2.21.0 make prefix= /usr/local/gitall make prefix= /usr/local/gitinstall
Step 3 – Setup Environment
After installation of git client. Now you just need to set binary in the system environment. Set the PATH variable with newly installed git binary in /etc/bashrc by executing below command. Also, reload the changes in the current environment.
echo "export PATH= /usr/local/git/bin:$PATH" >> /etc/bashrc source /etc/bashrc
After completing the steps. Let’s use the following command to check the current git version.
git --version git version 2.21.0
Git has been successfully installed on your system. Next, you can visit our Git tutorials section to read more about.