CentOS7 安装 Git
2019-12-20 本文已影响0人
骑着大象去上班
下载依赖包
yum -y install zlib-devel perl-ExtUtils-MakeMaker asciidoc xmlto openssl-devel
打开github的git源码地址,下载git最新源码
安装源码
源码地址:https://github.com/git/git/releases
wget https://github.com/git/git/releases/tag/v2.24.1
tar -zxvf v2.24.1
cd git-2.24.1
make configure
./configure --prefix=/usr/local/git
make && make install
设置环境变量
vim /etc/profile
加入以下配置到末尾
export PATH=/usr/local/git/bin:$PATH
使配置生效
source /etc/profile
查看git版本
git --version
git version 2.24.1
生成ssh密钥
git config --global user.name "qq.com"
git config --global user.email "qq.com"
ssh-keygen -t rsa -C "qq.com"