YouTube Icon

Code Playground.

How to Install Git on CentOS 7

CFG

How to Install Git on CentOS 7

This instructional exercise will walk you through the establishment and fundamental arrangement of Git on CentOS 7. 

Git is the most famous variant control framework that is being utilized by a huge number of activities. Git permits you to monitor your code changes, return to past stages, work all the while on numerous branches, and team up with your kindred engineers. 

Git is initially evolved by Linus Torvalds , the maker of the Linux part. 

At the hour of composing this article, the current variant of Git accessible in the default CentOS 7 storehouses is 1.8.3, which is quite obsolete. 

The least demanding approach to introduce the latest adaptation of Git (v2.18) is to introduce it utilizing the yum bundle the executives instrument from the Wandisco stores. 

Another alternative is to assemble Git from the source which permits you to introduce the most recent Git deliver and tweak the construct choices. Nonetheless, you won't have the option to refresh your Git establishment through the yum bundle supervisor. 

Prerequisites

Prior to proceeding with this instructional exercise, ensure you are signed in as root or a client with sudo advantages . 

Installing Git on CentOS 7

Follow these means to introduce the most recent Git rendition on your CentOS 7 framework: 

The initial step is to empower the Wandisco GIT archive. To do that, open your content tool and make another YUM vault design record named wandisco-git.repo in the/and so forth/yum.repos.d/catalog: 

sudo nano /etc/yum.repos.d/wandisco-git.repo

/etc/yum.repos.d/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

Import the archive GPG keys with: 

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

When the store is added, introduce the most recent variant of Git by running the accompanying order: 

sudo yum install git

To confirm the establishment type the order beneath which will print the Git variant: 

git --version

The yield will look something like beneath, implying that Git rendition 2.18.0 has been effectively introduced on your CentOS framework. 

git version 2.18.0

Since you have Git introduced it is a smart thought to set up your own data that will be utilized when you submit changes to your code. 

To set your git submit username and email address type: 

git config --global user.name "Your Name"
git config --global user.email "youremail@yourdomain.com"

Utilize the accompanying order to check the changes: 

git config --list
user.name=Your Name
user.email=youremail@yourdomain.com

~/.gitconfig

[user]
    name = Your Name
    email = youremail@yourdomain.com

To roll out additional improvements to your Git setup, you can either utilize the git config order or alter the ~/.gitconfig document by hand. 

Conclusion

We have told you the best way to introduce Git on your CentOS 7 machine. You should now visit the online form of the Pro Git book and study how to utilize Git. 

On the off chance that you hit an issue or have criticism, leave a remark underneath.




CFG