美文网首页
CentOS7 安装 Git

CentOS7 安装 Git

作者: 骑着大象去上班 | 来源:发表于2019-12-20 13:48 被阅读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"

相关文章

网友评论

      本文标题:CentOS7 安装 Git

      本文链接:https://www.haomeiwen.com/subject/wptinctx.html