阿里云服务器Centos7安装Git,并且实现与Github的连接

安装Git

首先,查看是否已安装过git,输入

git --version

没有出现版本则,输入

yum install git

接着对git进行初始化设置,即用户名和邮箱

git config --global user.name "yourname"
git config --global user.email "[email protected]"

生成证书

ssh-keygen -t rsa -C "[email protected]"

切换到ssh目录下 cd ~/.ssh/ 查看证书是否生成,id_rsa 表示私钥,id_rsa.pub表示公钥

通过cat id_rsa.pub获取公钥

 

连接Github

 

最后用 ssh [email protected]测试是否联通

发布了93 篇原创文章 · 获赞 93 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/qq_41937388/article/details/105334409