Nowadays, Git is a very famous version control system used by most of the open-source and commercial projects. It allows us to track code changes, revert into the previous stage of a project, and work with multiple branches and easy to collaborate with your fellow developers.
Git is designed and developed by Linus Torvalds, who has created Linux kernel.
At the time of writing this article, the CentOS 6 repository has Git 1.8.3 version, which is outdated today.
If you want to install the most recent version of Git (v2.22.0) with yum package manager, you need to use Wandisco repositories.
One of another option to install the latest version of Git is to install with source, where you need to use Source file of git to build and install, but the drawback is you will not be able to maintain your Git installation through the yum package manager.
[wandisco-git] name=Wandisco GIT Repository baseurl=http://opensource.wandisco.com/centos/6/git/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://opensource.wandisco.com/RPM-GPG-KEY-WANdisco
$ sudo rpm --import http://opensource.wandisco.com/RPM-GPG-Key-WANdisco
$ sudo yum install git
$ git --version
Output: git version 2.22.0
$ git config --global user.name “Your Username” $ git config --global user.email “Your Email ID”
$ git config --list
Output: user.name="satish" user.email="[email protected]"
[user] name = "satish" email = "[email protected]"
If you get any problem while installing Git into your system or have any feedback, feel free leave a comment below.