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 查看安装后的版本即可
版权声明:本文标题:Linux系统下安装git全教程,git安装包下载地址,阿里云服务器上安装git以及阿里云服务器修改yum源地址 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dongtai/1730050471a1220754.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论