git安装

本文详细介绍了在Linux系统中如何下载、安装和配置Git。首先从官方镜像站下载Git源码,然后通过yum安装依赖,接着进行编译和安装步骤,并最终将Git添加到系统路径中,确保全局可用。

一、Linux git安装

下载链接:https://www.kernel.org/pub/software/scm/git/

1.1 安装git

1.1.1 下载

wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.19.6.tar.gz

1.1.2 安装

yum -y install autoconf automake libtool
yum -y install gcc gcc-c++ make curl curl-devel expat-devel openssl openssl-libs openssl-devel zlib zlib-devel  pcre-devel libsepol-devel libcurl libcurl-devel keyutils-libs-devel krb5-devel libcom_err-devel libselinux-devel libverto-devel
yum -y install  perl-ExtUtils-MakeMaker
yum -y remove git

tar -zxf git-2.19.6.tar.gz
make configure
./configure --prefix=/usr/local/git
make profix=/usr/local/git
make install

echo "export PATH=\$PATH:/usr/local/git/bin" >> /etc/profile
source /etc/profile
git --version

1.1.3 脚本安装

#!/bin/bash
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.19.6.tar.gz
yum -y install autoconf automake libtool
yum -y install curl-devel expat-devel openssl-devel zlib-devel 
yum -y install gcc-c++ perl-ExtUtils-MakeMaker
yum -y remove git

tar -zxf git-2.19.6.tar.gz
make configure
./configure --prefix=/usr/local/git
make profix=/usr/local/git
make install

echo "export PATH=\$PATH:/usr/local/git/bin" >> /etc/profile
source /etc/profile
git --version
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值