从 github 上下载最新版的 git 源码打开网址:https://github.com/git/git/点击 releases,找到最新稳定版(不要下载带有-rc的,因为它代表了一个候选发布版本)获取到下载链接,比如:https://github.com/git/git/ar…wget 下载最新版$ wget https://github.com/git/git/archive/v2.19.2.tar.gz解压$ tar -zvxf v2.19.2.tar.gz 安装编译工具与依赖包$ yum groupinstall “Development Tools”$ yum install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel编译 git 源码$ cd git-2.19.2$ autoconf$ ./configure$ make && make install添加 git 符号链接$ ls /usr/local/bingit gitk git-shell git-upload-packgit-cvsserver git-receive-pack git-upload-archive$ ln -s /usr/local/bin/git /usr/binln: 创建符号链接 “/usr/bin/git”: 文件已存在$ rm /usr/bin/gitln -s /usr/local/bin/git /usr/bin$ git –versionv2.19.2设置 alias 节约生命$ git config –global alias.st status$ git config –global alias.co checkout$ git config –global alias.ci commit$ git config –global alias.br branch$ git config –global alias.pl pull$ git config –global alias.ps push