美文网首页
配置Git SSH

配置Git SSH

作者: DeamoV | 来源:发表于2018-07-30 01:03 被阅读13次

设置git ssh

  1. 设置自己的账户和用户名
# 配置自己的用户名
git config --global user.name "VDeamoV"
# 配置自己的邮箱
git config --global user.email  "yourEmail@outlook.com"
  1. 生成密钥
cd ~/.ssh
#切换到.ssh目录、生成密钥
ssh-keygen -t rsa -C "yourEmail@outlook.com"
  1. 私钥加入ssh-agent
ssh-add ~/.ssh/id_rsa

将私钥加入到ssh-agent。

  1. 将公钥加入到github账户ssh中
    id_rsa.pub文件放到Github用户设置中的SSH_Key中。
  2. 测试
ssh -T git@github.com

参考文献

本文主要参考的文献为gdutxiaoxu在CSDN的上的博客«Git ssh 配置及使用»

相关文章

网友评论

      本文标题:配置Git SSH

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