admin管理员组

文章数量:1665616

Linux系统下安装git全教程,git安装包下载地址,阿里云服务器上安装git以及阿里云服务器修改yum源地址教程

1.git下载地址(速度比官网下载快)

https://mirrors.edge.kernel/pub/software/scm/git/

2.上传.tar.gz到Linux中/usr/local文件夹中,再解压

3.修改阿里云yum镜像源

在使用yum指令时,报错error 404时,使用下面指令修改

sed -i 's/mirrors.cloud.aliyuncs/url_tmp/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/mirrors.aliyun/mirrors.cloud.aliyuncs/g' /etc/yum.repos.d/CentOS-Base.repo && sed -i 's/url_tmp/mirrors.aliyun/g' /etc/yum.repos.d/CentOS-Base.repo
yum clean all && yum makecache

4.进入安装目录,安装依赖包

yum groupinstall "Development Tools"

 5.继续安装依赖

yum install wget unzip gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel libcurl-devel expat-devel

6.编译安装git

按顺序执行指令

[root@localhost ~]# cd git-2.26.2/
[root@localhost git-2.26.2]# make configure
[root@localhost git-2.26.2]# ./configure --prefix=/usr/local/git
[root@localhost git-2.26.2]# make profix=/usr/local/git
[root@localhost git-2.26.2]# make install

7.将Git加⼊环境变量

Git 的可执⾏程序加⼊环境变量,便于后续使⽤ 编辑配置⽂件:
vim /etc/profile
尾部加⼊ Git bin 路径配置即可
export GIT_HOME=/usr/local/git
export PATH=$PATH:$GIT_HOME/bin
最后执⾏ source /etc/profile 使环境变量⽣效即可  

8.查看安装结果

执⾏ git --version 查看安装后的版本即可

 

本文标签: 阿里下载地址安装包器上源地址