Setting Latest Git Lab in Centos 6.x Version Step by Step Guide
Today I am writing this article on installing latest Git in CentOS 6.7 via source. Setting latest Git in CentOS 6.7
Actually in CentOS 6.7 , we are getting only 1.7.1 version but the latest Git version is git-2.6.3. And while installing I’ve been through lot of R&D.
Here I am providing you everything in a single article.
Here the available version of git in CentOS 6.7.
[localserver@dhcppc2 ~]$ yum list git Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: mirrors.vonline.vn * extras: mirrors.vonline.vn * updates: mirrors.vonline.vn Available Packages git.i686 1.7.1-3.el6_4.1 base [localserver@dhcppc2 ~]$
Lets begin with install
1. Create a directory
mkdir git cd git
2. Get git downloaded using wget and unrar it
wget https://www.kernel.org/pub/software/scm/git/git-2.6.3.tar.gz tar -xvf git-2.6.3.tar.gz
and then change into directory
cd git-2.6.3
3. Actually in Linux , source based installation are can done with 3 easy steps and they are
./configure make make install ( as root user in the same directory )
When I have started “./configure” I came to know that gcc has not installed in my CentOS6.7. so installing it with
yum install gcc
Then continued to configure and again I got stucked with
cache.h:21:18: warning: zlib.h: No such file or directory Can't locate ExtUtils/MakeMaker.pm /bin/sh: msgfmt: command not found
errors. so to stop all these errors I am giving all libraries in single line
yum install zlib zlib-devel perl-ExtUtils-MakeMaker gettext -y
Then run these commands again
./confgure make make install (as root)
that’s it. Git installation got completed.
Now execute below steps to configure your Git and make sure you have a Git account with same E-mail.
git config --global user.name "Raja Sekhar Reddy G" git config --global user.email "raja.genupula@yahoo.com"
Till now all we have done installation and configuring of Git . Now lets make a SSH based communication between your localrepo’s to your Git account.
1. Generate SSH key with your E-mail of Github account
ssh-keygen -t rsa -b 4096 -C "raja.genupula@yahoo.com"
2. Make sure SSH-Agent running , it will help us here with key based authentication.
eval "$(ssh-agent -s)"
from the above command if PID got returned then that means SSH-Agent running
and then execute below command
ssh-add ~/.ssh/id_rsa
3. Now open your Public key with below command and copy it.
cat ~/.ssh/id_rsa.pub
4. Login to your GitHub account.
Github home page -> Settings -> SSH Keys -> Add SSH Keys
It will open a Input field, paste your copied key and submit.
5. Come to your terminal and type this
ssh -T git@github.com
You will get similar message like below
Hi rajagennu! You’ve successfully authenticated, but GitHub does not provide shell access.
—————
Congratulations!! you just setup Git account locally with SSH communication.
In the next article I will show you how to work with Git and committing changes from local to web and vice versa.
Good luck!!
Thanks for your wonderful Support and Encouragement