Installation of GIT on Linux-CentOS
Before installing the GIT first, we have to verify that GIT is not there
#git — — version
That means GIT is not installed on our system
There are two ways to install the GIT on our system
We have to download the source code and make a build and then we can install it.
Using YUM, (but it's installed an older version of git)
We are installing GIT through option one
Option-1: - Installing the latest version of git from the IUS repository
Step 1: - Install Development Tools
Go to:-
#cd /etc/yum.repos.d
#yum group install “Development Tools”
#yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
Step 2: - Now we are going to build
We have to download the package using the wget command If the wget tool is not installed then first we have to install it using the below command
Verify:-
#which wget
If not present then install it through the below command
#yum install wget
After installing wget, download the latest package of git, today date the latest version of git is 2.39.2 using the below command and link
#wget
https://www.kernel.org/pub/software/scm/git/git-2.39.2.tar.gz
— no-check-certificate
After downloading Extract, the file
#tar -xvf <file_name>
Once it extracts go into the file
#cd <file_name>
Step 3: - Now we have to buit the process
#make configure
Now we have to define where the built has to be saved
#./configure –prefix=/usr/local
#make install
Verify: -
#which git
#git — — version
Congratulations, you have successfully latest version of GIT on your local machine
Option-2:- Installing the GIT using YUM
To install Git on CentOS, follow these simple steps
Open the terminal on your CentOS machine
Type the following command to install Git:
#sudo yum update
#sudo yum install git -y
#git — version
Press Enter to confirm the installation.
Wait for the installation to complete
That’s it! Git should
I hope you found this post helpful. Happy coding!
Thank You!
Pawan Bhagat