Hello, friends. In this short post, you will learn how to install Git on CentOS 9 Stream / Fedora 37.
Introduction
Git is an open source, cross-platform distributed version control system (DVCS) that was initially developed by Linus Torvalds in 2005. Believe it or not, there are a staggering number of software projects that rely on Git for version control, including commercial and open-source projects.
This makes Git a must for every developer and professional involved in the software lifecycle.
So, it’s not too complex to install Git on Linux, and today we’re going to demonstrate it for you.
Installing Git on CentOS 9 Stream / Fedora 37
There are two ways to install Git. The first is to install it from the official CentOS / Fedora repositories.
To achieve this, open a terminal and update your system
sudo dnf update
And then, install Git with the command
sudo dnf install git
Then, you can check the installed version with the command
git --version
![1.- Git on CentOS 9 Stream / Fedora 37](https://unixcop.com/wp-content/uploads/2022/05/1-6.png)
But if you want to have the latest stable version, then the best thing to do is to compile the Git source code. To achieve this, install wget
and the basic packages to compile.
sudo dnf install wget tar gettext-devel curl-devel expat-devel expat-devel openssl-devel perl-CPAN perl-devel zlib-devel unzip cmake gcc make
Then download the latest version of the git code.
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.39.1.tar.gz
Then unzip it
tar xvzf git-2.39.1.tar.gz
Thereafter, navigate to the generated folder
cd git-2.39.1
Next, compile the code.
sudo make prefix=/usr/local all
Finally, install git
sudo make prefix=/usr/local install
And check the version
git --version
git version 2.39.1
Conclusion
Thanks to this post, you learned how to install Git on CentOS 9 Stream, which is a system that still has a lot to give.