windows生成github密钥并推送文件踩坑

强调官方文档最可靠,百度踩坑很浪费时间,建议去寻找一手数据源头
github官方文档提供了帮助

  1. 第一步 查看密钥
    如果您还没有 SSH 密钥,则必须生成新 SSH 密钥。 如果您不确定是否已有 SSH 密钥,请检查现有密钥。
    ls -al ~/.ssh

  2. 生成密钥(如果已有跳过)
    $ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
    如果不是在 .ssh目录生成的,需要把密钥复制到当前用户下.ssh文件夹(这个文件夹是隐藏文件夹)

  3. 将 SSH 密钥添加到 ssh-agent
    确保 ssh-agent 正在运行
    $ ssh-add ~/.ssh/id_rsa
    若执行ssh-add 是出现这个错误:Could not open a connection to your authentication agent,则先执行如下命令即可:
    ssh-agent bash

  4. 将 SSH 密钥添加到 GitHub 帐户

官方文档 https://help.github.com/cn/articles/adding-a-new-ssh-key-to-your-github-account

-------------------------------------------------------------------------
## 极客时间全网最便宜最优惠购买方式,优惠券返现 百度网盘 微信关注公众号“选门好课”
扫描下方二维码关注我的公众号"选门好课",与我一起交流知识
原文地址:https://www.cnblogs.com/singworld/p/11596579.html