Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JessonYue/f0c5db29bb5c1285a3182a7734544532 to your computer and use it in GitHub Desktop.
Save JessonYue/f0c5db29bb5c1285a3182a7734544532 to your computer and use it in GitHub Desktop.
如何在CentOS 6.x/7.x上安装git及最新版
下载
# wget https://www.kernel.org/pub/software/scm/git/git-2.5.0.tar.gz
# tar -zxvf git-2.5.0.tar.gz
编译安装
# cd git-2.5.0
# make prefix=/usr/local/git all
# make prefix=/usr/local/git install
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc
检查git版本
# git --version
git version 2.5.0
注意:如果安装完查看版本不是我们安装的最新版,请重新执行下面的操作
# yum remove -y git
# source /etc/bashrc
# git --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment