Git is a popular version-control system that tracks changes to your code and code management. Thousands of web programmers use Git to achieve speed and data integrity for their projects. 

If you find that the default Git version installed on your CentOS or AlmaLinux system may be outdated, we can install the latest version of Git.

We will move forward with the assumption that you are logged in with root or a sudo user. 

The following are the steps to install Git on CentOS/AlmaLinux: 

Step 1: Create a new file named wandisco-git.repo inside the /etc/yum.repos.d/ path using the command given below:

# sudo vi /etc/yum.repos.d/wandisco-git.repo

Step 2: Add the following lines to wandisco-git. repo:

[wandisco-git]
name=Wandisco GIT Repository
baseurl=http://opensource.wandisco.com/centos/7/git/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco

Step 3: We will import the Repository GPG Key using the following command:

#sudo rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco

Step 4: Now, we will run the command given below to install the latest version of Git:

#sudo yum install git

Step 5: Verify the Git version using this command:

#git --version 

It should give output with the latest version of Git.

git version 2.22.0

git-version.png

Step 7: Once Git is installed, we will add personal information using git-config.

# git config --global user.the name "Your Name"
# git config --global user.email "[email protected]"

Step 8: Execute the command given below for the verification of your details.

# git config --global user.email "[email protected]"

Congratulations!
You have successfully installed and configured the latest version of Git on CentOS/AlmaLinux.

Was this answer helpful? 0 Users Found This Useful (0 Votes)