Created
May 10, 2017 19:56
-
-
Save mahamuniraviraj/ac4807c43694ec4d8d360ebf12e93df1 to your computer and use it in GitHub Desktop.
Install Latest Git On Cent OS 7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Centos 7.3 comes with 1.8.3 | |
# so update git from centos repo | |
yum update git | |
# it shows nothing to update | |
# we download git source and build and install latest git on Centos 7.3 | |
# Go to https://github.com/git/git/releases to get latest git release | |
# download tar.gz file in /opt folder https://github.com/git/git/archive/vX.XX.XX.tar.gz XX is versio no | |
cd /opt | |
ll | |
# extract tar.gz | |
tar -zxf vX.XX.X.tar.gz | |
cd vX.XX.X | |
# install development tools | |
yum groupinstall 'Development Tools' | |
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-ExtUtils-MakeMaker | |
# confirm we are in git source directory | |
pwd | |
# Compile git from sources | |
make prefix=/usr/local/git all | |
# install git | |
make prefix=/usr/local/git install | |
# Check version | |
git --version | |
# still shows version 1.8 | |
set path to new version | |
# create script file to set path | |
vi /etc/profile.d/setGitPath.sh | |
# press insert and type following commands | |
#!/bin/sh | |
# set git path to latest installed git version 2.13.0 (/usr/local/git/bin/git) | |
# instead of preinstalled git version 1.8.3 (/bin/git) | |
export PATH=/usr/local/git/bin:$PATH | |
#press escape and type :wqa to save and exit | |
# apply changes | |
source /etc/profile.d/setGitPath.sh | |
# check version | |
git --version | |
Very helpful for me too. Thanks!
It works well. Thanks a lot!
Pretty good. To improve to newbie people like me, it could had some command below the download comment, like:
#download tar.gz file in /opt folder https://github.com/git/git/archive/vX.XX.XX.tar.gz XX is versio no
wget https://github.com/git/git/archive/vX.XX.XX.tar.gz
or
curl -LJO https://github.com/git/git/archive/vX.XX.XX.tar.gz
But anyway, thanks!
two thumbs up
works. thanks a lot
Thank you so so much.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good instructions. Very helpful. Thanks.