How to install Git on Centos7?

Git is a famous version-control system. Git is used to tracking the changes made on your code as well as code management. Thousands of Web-programmers uses Git to achieve speed and data integrity for their projects. You may find the Default Git version installed on your Centos which may be outdated. Here, we will install the latest version of Git.

We assume that you are logged in with root or sudo user. Following are the steps to install Git on Centos.

 

  1. Create a new file name wandisco-git.repo inside /etc/yum.repos.d/ path using below command.

    # sudo vi /etc/yum.repos.d/wandisco-git.repo
    
  2. Add the following lines in wandisco-git.repo.

    [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
    
  3. We will import the Repository GPG Key using below command.

    #sudo rpm --import http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
    

 

  1. Now, we will run below command to install the latest version of Git.

    #sudo yum install git
  2. Verify the Git version using below command.

    #git --version

          It should give Output with the latest version of Git.

git version 2.22.0

          

  1. Once Git is installed, we will add personal information using git-config.

    git config --global user.name "Your Name"
    git config --global user.email "[email protected]"
  2. Hit below command for the verification of your Details.

    git config --global user.email "[email protected]"

          Congratulations! You have successfully installed and configured latest version of Git on Centos 7.

Related Articles

How to Kill a Process Running on Specific Port in Linux?

First of all, we will need to identify the Process ID which runs on any port. Once we find the...

How to Compress and Extract Files Using the tar Command on Linux?

It is a very easy step to create archive files with .tar.gz or .tgz files. It is also called...

How to Install OpenJDK JAVA 11/8 on Ubuntu?

You can follow this tutorial to install JAVA OpenJDK in all the Ubuntu versions. Following are...

how to configure SSH key-based Authentication in Linux VPS or Dedicated Server

This article will guide how to configure SSH key-based Authentication in Linux VPS or Dedicated...

Do You Provide TUN/TAP On VPS Hosting?

Typically, TUN/TAP is used when you want to utilize VPN services from your VPS. Windows VPS...

  • 0 Users Found This Useful

Was this answer helpful?