1)卸载系统自带的低版本git(2.17.1)
root@ubuntu:/home/imhqq/share/fsl-release-bsp/bld-x11
# git --version
git version 2.17.1
# which -a git
#/usr/bin/git
#rm -rf /usr/bin/git
2)编译安装最新的git版本
# cd /usr/local/src/
# wget https://www.kernel.org/pub/software/scm/git/git-2.22.0.tar.xz
# tar -vxf git-2.22.0.tar.xz
# cd git-2.22.0
# apt-get install libcurl4-openssl-dev
# make -j8 prefix=/usr/local/git all
# make -j8 prefix=/usr/local/git install
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
# source /etc/profile
更新成功
# git --version
git version 2.22.0
网友评论