[root@iZbp14eey5dlgt99xx7qptZ data]# pwd
/data
[root@iZbp14eey5dlgt99xx7qptZ data]# tar -zxvf git-2.27.0.tar.gz
安装依赖包
//make: curl-config: Command not found// CC fuzz-commit-graph.o//In file included from commit-graph.h:4,// from fuzz-commit-graph.c:1://git-compat-util.h:297:10: fatal error: openssl/ssl.h: No such file or directory// #include <openssl/ssl.h>// ^~~~~~~~~~~~~~~//compilation terminated.//make: *** [Makefile:2391: fuzz-commit-graph.o] Error 1
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
卸载旧版本git
//安装依赖包时,系统自动安装了git
yum -y remove git
编译
[root@iZbp14eey5dlgt99xx7qptZ git-2.27.0]# pwd
/data/git-2.27.0[root@iZbp14eey5dlgt99xx7qptZ git-2.27.0]# make prefix=/usr/local/git all
安装到指定路径
make prefix=/usr/local/git install
配置环境变量
vi /etc/profile //底部加 export PATH=$PATH:/usr/local/git/bin
source /etc/profile //刷新环境变量
[root@iZbp14eey5dlgt99xx7qptZ mygit]# ssh-keygen -t rsa -C"3***2@qq.com"
Generating public/private rsa key pair.
Enter file in which to save the key(/root/.ssh/id_rsa):Z***
Enter passphrase(empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase(empty for no passphrase):
Enter same passphrase again:
Passphrases do not match. Try again.
Enter passphrase(empty for no passphrase):
Enter same passphrase again:
Your identification has been saved inZ***.
Your public key has been saved inZ***.pub.
The key fingerprint is:SHA256:r3+5***b0XUMnjlRSTNoKwSc 3***2@qq.com
The key's randomart image is:+---[RSA3072]----+|...=+||E.o++.||.+.+.o ||....+||.S......||...+.o ||.=B.*+||.o Bo=.B+||.o.o.++=**|+----[SHA256]-----+
将私钥id_rsa添加到ssh代理中
[root@iZbp14eey5dlgt99xx7qptZ mygit]# pwd
/myhome/mygit
[root@iZbp14eey5dlgt99xx7qptZ mygit]# ssh-add puhomeid
Could not open a connection to your authentication agent.[root@iZbp14eey5dlgt99xx7qptZ mygit]# eval $(ssh-agent -s)
Agent pid 44138[root@iZbp14eey5dlgt99xx7qptZ mygit]# ssh-add puhomeid
Enter passphrase for puhomeid:
Bad passphrase,try again for puhomeid:
Identity added:puhomeid(36***2@qq.com)
将公钥id_rsa.pub添加到github仓库中
[root@iZbp14eey5dlgt99xx7qptZ mygit]# pwd
/myhome/mygit
[root@iZbp14eey5dlgt99xx7qptZ mygit]# vim puhomeid.pub //复制公钥内容
安装解压[root@iZbp14eey5dlgt99xx7qptZ data]# pwd/data[root@iZbp14eey5dlgt99xx7qptZ data]# tar -zxvf git-2.27.0.tar.gz 安装依赖包//make: curl-config: Command not found// CC fuzz-commit-graph.o//In file included from commit-graph.h:4,// f