Linux安装Git

1、使用yum安装

# yum -y install git
# yum remove git

2、源代码安装

---安装依赖的包
# yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
# cd /usr/local
----下载git源码
# wget https://github.com/git/git/archive/v2.21.0.tar.gz
----解压git源码
# tar -zxvf v2.21.0.tar.gz
# cd git-2.21.0/
# mkdir /usr/local/git
----编译安装到指定目录
# make prefix=/usr/local/git all
# sudo make prefix=/usr/local/git install
# vim /etc/profile
----添加在文件的最后一行
export PATH=/usr/local/git/bin:$PATH
# source /etc/profile
# git --version
    原文作者:試毅_思伟
    原文地址: https://www.jianshu.com/p/f2da5e76a588
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞