Installation of Git on CentOS 8
The latest and stable version of Git is available in the official DNF package repository of the CentOS 8 Operating system, and we can download and install Git from there.
We just have first to upgrade the DNF package repository cache using the command given below:
Upgrade already installed packages as well using the command:
When the system’s upgradation is completed, execute the Git’s installation command typed below:
The ‘-y’ flag will answer yes to the prompt that occurred by the system and confirm the installation.
The Git is completely installed on the CentOS 8 operating system, and the installation can be verified using the command provided below:
You can witness in the screenshot attached that version 2.8.2 of Git is successfully installed on the CentOS 8 operating system. Now let’s see how to set up the basic configuration of Git for getting started with it.
How to Setup basic Configuration of Git on CentOS 8
After completing the installation phase of Git on CentOS 8, let’s perform some basic configuration of Git to get a fresh start.
First, we should configure the username and email address so that the commit messages will have the right information. We can configure both username and email address using the git config command as shown in the commands given below:
$ git config --global user.email "[email protected]"
This information will be stored in the ‘.gitconfig’ configuration file of the Git, and if you want to take a look again or edit that information, you can use the command provided below:
After viewing the detail or changing it as per our desire, save the file and exit using the keyboard shortcut keys CTRL + S and CTRL + X.
This is how you can install, configure, and get started with Git on the CentOS 8 Operating system. You have learned a simple and straightforward method to install Git on CentOS 8 from its Official DNF package repository and configure the user name and email address for the commit messages.