CentOS 6.9 安装最新版本 git
从 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/bin git gitk git-shell git-upload-pack git-cvsserver git-receive-pack git-upload-archive
$ ln -s /usr/local/bin/git /usr/bin ln: 创建符号链接 "/usr/bin/git": 文件已存在
$ rm /usr/bin/git
ln -s /usr/local/bin/git /usr/bin
$ git --version v2.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
相关推荐
87447007 2020-07-19
Equation 2020-08-09
iamjiyu 2020-07-21
formula 2020-11-12
huhongfei 2020-11-05
乾坤一碼農 2020-10-27
liumengyanysu 2020-10-22
E哥的aws认证攻略 2020-10-15
tianyafengxin 2020-10-08
guying 2020-10-05
好脑筋不如烂笔头 2020-09-17
nebulali 2020-09-11
佛系程序员J 2020-09-15
fenggit 2020-09-15
JustHaveTry 2020-09-11
兄dei努力赚钱吧 2020-09-06
IngeniousIT 2020-08-25