1. 安装步骤
1> 首先应该安装好必要的依赖包,省得在安装过程中出现各种问题。
# yum install curl-devel expat-develgettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
2> 下载并编译git
# wget https://www.kernel.org/pub/software/scm/git/git-1.8.3.1.tar.gz
# tar xzf git-1.8.3.1.tar.gz
3> 编译并验证
# cdgit-1.8.3.1
# makeprefix=/usr/local/git all
# makeprefix=/usr/local/git install
# echo"export PATH=$PATH:/usr/local/git/bin" >>/etc/bashrc
# source/etc/bashrc
# git--version
4> 生成密钥
#cd/root/.ssh
#ssh-keygen-t rsa
Generatingpublic/private rsa key pair.
Enterfile in which to save the key (/root/.ssh/id_rsa): (直接回车)
Enterpassphrase (empty for no passphrase): (直接回车)
Entersame passphrase again: (直接回车)
Youridentification has been saved in /root/.ssh/id_rsa.
Yourpublic key has been saved in /root/.ssh/id_rsa.pub.
The keyfingerprint is:
密钥图片
在root/.ssh目录下生成密钥对 id_rsa和id_rsa.pub,其中id_rsa是私钥,id_rsa.pub是公钥。
5> 登录github帐号,添加公钥
https://github.com 登录个人帐号,进入setting/keys, 点击 SSH and GPG keys 添加密钥 即可。
2、 参考博客:
https://blog.csdn.net/huashao0602/article/details/53507781
https://blog.csdn.net/huashao0602/article/details/53486522