Windows或Linux环境下安装Git

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Caiaixiong/article/details/89117109

Windows

Linux

  1. yum命令安装
#安装的git不是最新版本,如需最新版本需要自行编译
yum install git 
  1. Git源码编译安装
#1.前往https://mirrors.edge.kernel.org/pub/software/scm/git/下载合适版本
#2.安装git依赖
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
yum install gcc perl-ExtUtils-MakeMaker
#3.移除已经安装的git
yum remove git
#4.切换到解压的根目录
cd git的解压目录
#5.预编译
./configure --prefix=/usr/local/git_2.9.5
#6.编译并安装
make && make install
#7.将git的脚本软链接到/usr/bin/目录下
ln -s /usr/local/git_2.9.5/bin/* /usr/bin


猜你喜欢

转载自blog.csdn.net/Caiaixiong/article/details/89117109