DropVPS Team
Writer: John hens
How to Install Git on CentOS 8 and 7

Table of Contents
What you will read?
Git is the most popular version control system for developers and system administrators. On CentOS 8 and CentOS 7, installing Git is straightforward with the built-in package manager
Step 1: Update Your System
Before installing any package, update the CentOS system to ensure all repositories and dependencies are up to date:
sudo yum update -y
Step 2: Install Git
You can install Git directly from the CentOS repositories using the yum package manager:
sudo yum install git -y
After installation, check the Git version to confirm it was installed correctly:
git --version
Step 3: Configure Git
Once Git is installed, set up your user information. This data will be linked to your commits:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Verify the configuration with:
git config --list
Step 4: Verify Git Installation
Before using Git, it’s a good idea to make sure the installation works. You can do this by creating a small test repository:
mkdir git-test
cd git-test
git init
If the message “Initialized empty Git repository” appears, Git is working correctly on your CentOS system.