Git installation on Linux

0
619

Git

Git is a version control system that is used for software development and other version control tasks. As a distributed revision control system it is aimed at speed, data integrity,and support for distributed, non-linear workflows. In this article, we will be known about the  Git installation on Linux.

Before we going to proceed with Git installation, install prerequisites.

[root@localhost ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel 
[root@localhost ~]# yum install gcc perl-ExtUtils-MakeMaker

Now download The latest version of Git from their official site

Download the Git version 2.10.1 with wget command as follows

wget https://www.kernel.org/pub/software/scm/git/git-2.10.1.tar.gz

Sample Output:

git-download

Now copy it to the Directory /usr/src/ by using the cp command, then extract it.

[root@localhost ~]# cp -rf git-2.10.1.tar.gz /usr/src
[root@localhost ~]# cd /usr/src
[root@localhost src]# tar -zxf git-2.10.1.tar.gz

Now change to Git Directory by cd command and then compile the source code by using following commands.

[root@localhost git-2.10.1]#cd git-2.8.1
[root@localhost git-2.10.1]# make prefix=/usr/local/git all

sample Output:
git-compile

[root@localhost git-2.10.1]# make prefix=/usr/local/git install

git-compile-1

Now add the path in your system environment by using the following command

[root@localhost git-2.10.1]# echo export PATH=/usr/local/git/bin:$PATH >> /etc/bashrc

Then execute the following command to reload the configuration

[root@localhost git-2.10.1]# source /etc/bashrc

 

Now check the git version by using git –version command as follows

git-installation-version

Now Enjoy latest version of Git on your machine.