一、安装
使用yum进行安装
[root@localhost lib]# yum install git
验证是否安装完成
[root@localhost lib]# git version
git version 1.8.3.1
二、配置git
[root@localhost lib]# git config --global user.name "huangbaokang"
[root@localhost lib]# git config --global user.email "[email protected]"
三、生成授权证书
[root@localhost lib]# ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:lRm1H3lU+vtobqXln8yC2D8OJNwh3cpnofPo1nxAwE0 [email protected]
The key's randomart image is:
+---[RSA 2048]----+
| o.+E +|
| .*.o + |
| .+ooo+ .|
| ..+ +o.+ |
| So B.o. .|
| o *. +|
| oo+..* |
| ..+.=*o+|
| ..o**++|
+----[SHA256]-----+
将git证书配置到github上,保证Linux服务器与github的连通性。
登录到github上(没有用户,自己注册一个)
把我们产生的公钥信息id_rsa.pub粘贴到github的配置中,如下图所示:
验证linux跟github的连通性
[root@localhost lib]ssh git@github.com
专业墙纸贴纸厨房用具装饰出售,本人网店经营,访问即是爱
博客对你有用记得访问下哦,增加下访问量,如有需要可以下单购买哦^_^。店铺地址https://item.taobao.com/item.htm?id=570637716145