In this tutorial we’ll learn how to install Git on CentOS 7. We will also install and configure its prerequisites. Git is a distributed version control program, which you can use to monitor the code varies (versions) while developing software. Git offers features such as reverting to a prior stage, multiple workflows, neighborhood branching and lots of others. This makes Git one of the best variant control systems and that is why it is used by many software developers.
I recommend to use a minimal CentOS server setup as a basis for the tutorial, that can be a virtual or a root server image with an CentOS 7 minimal install from a web hosting company or you use our minimal server tutorial to install a server from scratch.
Install Git on CentOS 7
Step 1. First, ensure your system is fully up-to-date by running the following:
yum -y update
Step 2. Installing Git.
Easy way to install git on CentOS with yum:
yum install git
You can check the version of git that was installed by using the following command:
Step 3. Configuration of Git on CentOS 7.
The first thing that you might want to do after the installation is to configure your own name and email address in Git so the changes you commit contain the correct information. You can do that by using the following commands:
git config --global user.name "Your Name" git config --global user.email "firstname.lastname@example.org"
Next we’ll verify the configuration changes by viewing the .gitconfig:
git config --list
For more information and command line options you can use the –help flag:
Congratulation’s! You have successfully install and configured Git on your CentOS 7 server. Thanks for using this tutorial for installing Git on CentOS 7 system.