Skip to content

Instantly share code, notes, and snippets.

@yuhangch
Last active March 5, 2020 02:35
Show Gist options
  • Save yuhangch/e670bdd63990b48849e8be01d55a3cd1 to your computer and use it in GitHub Desktop.
Save yuhangch/e670bdd63990b48849e8be01d55a3cd1 to your computer and use it in GitHub Desktop.
centos 7 upgrade git

0)install dependencies

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

1)uninstall builtin version(1.8.1)

[root@qcloud ~]# git --version
git version 1.8.1
[root@qcloud ~]# yum remove git

2)Download/Compile latest version

[root@qcloud ~]# cd /usr/local/src/
[root@qcloud src]# wget https://www.kernel.org/pub/software/scm/git/git-2.15.1.tar.xz
[root@qcloud src]# tar -vxf git-2.15.1.tar.xz
[root@qcloud src]# cd git-2.15.1
[root@qcloud git-2.15.1]# make prefix=/usr/local/git all
[root@qcloud git-2.15.1]# make prefix=/usr/local/git install
[root@qcloud git-2.15.1]# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
[root@qcloud git-2.15.1]# source /etc/profile
[root@qcloud ~]# git --version
git version 2.15.1

reference:

散尽浮华

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment