码迷,mamicode.com
首页 > 系统相关 > 详细

linux centos7.6更新git版本

时间:2020-12-22 11:57:00      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:echo   centos7   Fix   div   wget   file   etc   更新   centos   

 

 

//

 

#!/bin/bash
# Your Answer
# filename: gitrefresh.sh
# chmod u+x gitrefresh.sh
# ./gitrefresh.sh

sudo yum remove git -y

rm -rf /usr/local/git
mkdir /usr/local/git
cd /usr/local/git

# 安装依赖库
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel -y
yum install gcc perl-ExtUtils-MakeMaker -y

wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz
# cp /home/git-2.9.5.tar.gz /usr/local/git
tar -zxvf git-2.9.5.tar.gz
cd git-2.9.5
./configure --prefix=/usr/local/git
make && make install

echo export PATH=/usr/local/git/bin:$PATH >> /etc/profile
# 生效环境变量
source /etc/profile

git --version

 

 

//

linux centos7.6更新git版本

标签:echo   centos7   Fix   div   wget   file   etc   更新   centos   

原文地址:https://www.cnblogs.com/RYSBlog/p/14147814.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!