How to Install Git on CentOS 8

Table of Contents
Installing Git on CentOS 8
Git is the most popular version control system nowadays. It helps to share and collaborate on software development projects. It is mainly used for source code management. In this tutorial, you are going to learn how to install Git on CentOS 8.
Prerequisites
Before you start installing Git on CentOS 8. You must have the non-root user account on your Server or Desktop with sudo privileges.
1. Install Git on CentOS
To install the latest Git in CentOS you will need to enable the GIT repository in CentOS. First, create a new file inside /etc/yum.repos.d/
directory using the following command. Then copy the lines given below the command.
sudo nano /etc/yum.repos.d/wandisco-git.repo
Copy below lines inside the above-created file.
[wandisco-git] name=Wandisco GIT Repository baseurl=http://opensource.wandisco.com/centos/7/git/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
Now save and exit the editory typing CTRL+X then typing ‘Y’.
Next, Import GPG key for added repository key typing below command.
sudo rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
Now install Git by typing following command:
sudo yum install git
Confirm the installation and check the version executing the following command
git --version
The output should be:
git version 2.18.0
2. Setting Up Git
To prevent warning every time you should configure it perfectly by using your Git information
First set the global username for Git
git config --global user.name "User Name"
Secondly set global email for Git
git config --global user.email "[email protected]"
You can also change the above configuration by editing the .gitconfig file. To edit gitconfig file type
nano ~/.gitconfig
Edit the above file by setting Name and Email.
Conclusion
Here we have successfully learned how to install Git on CentOS 8 and you have also learned setting up Git to start working on the system. If You have any queries regarding this please don’t forget to comment below.
LATEST POSTS
-
How to Install Arduino IDE on Ubuntu 18.04
-
How to install LAMP stack on Debian 9
-
How to Install IntelliJ IDEA IDE on Debian 10
-
How to Install Laravel PHP Framework With Nginx on CentOS 8
-
How to Install Gradle on Linux Mint 19
-
How to Install PyCharm on Debian 10
-
How to install Laravel PHP Framework With Nginx on Ubuntu 18.04
-
How to Install Google Chrome on Linux Mint 19
-
How to Set Up Cron Job on CentOS 7
-
How to Install phpMyAdmin on Debian 10
-
How to Install RubyMine on CentOS 8
-
How to Install PyCharm on Ubuntu 18.04