Easy Steps To Install Latest Git on AlmaLinux 8

This tutorial intends to teach you How To Install Latest Git on AlmaLinux 8. Git is a DevOps tool used for source code management. It is a free and open-source version control system used to handle small to very large projects efficiently. Git is used to track changes in the source code, enabling multiple developers to work together on non-linear development. Linus Torvald created Git in 2005 for the development of the Linux kernel.

You can now proceed to the guide steps below on the Orcacore website to set up the latest version of Git on AlmaLinux 8.

Steps To Install Latest Git on AlmaLinux 8

To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on the Initial Server Setup with AlmaLinux 8.

1. Download and Install Git From Source

Git packages are available in the default AlmaLinux repository. But in this guide, we will install Git in the latest version.

First, update your local package index with the command below:

sudo dnf update -y

Then, use the following command to install the required packages and dependencies:

sudo dnf install gettext-devel curl-devel expat-devel openssl-devel perl-CPAN perl-devel zlib-devel unzip cmake gcc make wget -y

Now you need to visit the Git Release page and find the master zip archive or the latest stable release from Git.

Next, use the wget command to download the Latest git on AlmaLinux 8:

wget https://github.com/git/git/archive/refs/tags/v2.37.3.zip

When your download is completed, unzip your file with the command below:

sudo unzip v2.37.3.zip

Switch to your Git directory:

cd git-2.37.3

At this point, use the following commands to install Git:

# sudo make prefix=/usr/local all
# sudo make prefix=/usr/local install

When you are done, verify your Git installation on AlmaLinux 8 by checking its version:

git --version
Output
git version 2.37.3

2. Set up and Configure Git on AlmaLinux 8

At this point, you must configure Git so that the generated commit messages you make will contain the correct information and support you as you build your software project.

You must provide your name and email address because Git embeds this information into each commit you make. To do this, you can use the following commands:

# git config --global user.name "Your Name"
# git config --global user.email "youremail@domain.com"

After setting up the user name and email ID, you can verify the details using git config --list command:

git config --list
git config list

All the configuration done through the git command will save the information in a file called .gitconfig in the user’s home directory. So you can also verify the configuration by checking this file using cat ~/.gitconfig command as shown below:

cat ~/.gitconfig
verify git configuration

3. Testing Git with Git Clone Command

Now that you have set up Git on AlmaLinux 8, you can try using it by performing git clone operations from GitHub.

We can just clone a repository called wig by using the following command, as shown below. This will create a directory wig in your local system and copy all the contents from the repository:

git clone https://github.com/jekyc/wig.git
Testing Git with Git Clone Command

Also, you can check all the subcommands available with the git command using git help -a command as shown below:

git help -a

To have the git status, you can use the command below:

git status

Conclusion

At this point, you have learned to install the Latest Git on AlmaLinux 8. Installing the latest Git on AlmaLinux 8 requires enabling the EPEL and PowerTools repositories or building from source. Using dnf install git provides the default version, but for the latest release, compiling from source ensures access to the newest features and fixes.

Hope you enjoy it. You may also like these articles:

Install and Configure NTP Server and Client on AlmaLinux 9

How To Install MariaDB 10.9 on AlmaLinux 9

Install Python 3.13 on AlmaLinux

Almalinux 10 Release Date and Download

AlmaLinux bootc Integration

Share your love

Stay informed and not overwhelmed, subscribe now!