【技术宅】Linux CentOS系统 Git更新安装

发布于 2019-12-24  64586 次阅读


卸载现有Git

yum remove git

2)编译安装最新的git版本

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

如果是非root用户使用git,则需要配置下该用户下的环境变量

echo "export PATH=$PATH:/usr/local/git/bin" >> ~/.bashrc
source ~/.bashrc
郑州90后一名计算机爱好者,希望能通过网络结交更多朋友!
最后更新于 2019-12-24