1. git客户端输入ssh-keygen -t rsa -C "你的邮箱地址"
  2. Enter file in which to save the key (C:\Users\Administrator\.ssh\id_rsa):   #不填直接回车

    Enter passphrase (empty for no passphrase):   #不设置密码直接回车

    Enter same passphrase again:  #不设置密码直接回车

    Your identification has been saved in C:\Users\Administrator\.ssh\id_rsa.   #生成的密钥位置

    Your public key has been saved in C:\Users\Administrator\.ssh\id_rsa.pub.  #生成的公钥位置

  3. 使用记事本打开C:\Users\Administrator\.ssh\id_rsa.pub

  4. 复制上述文件中的内容到gitee -->设置 -->ssh公钥

  5. 点击确定后,git客户端输入ssh -T git@github.com,跳出的对话框输入yes,随后跳出此代码则设置成功You've successfully authenticated, but GitHub does not provide shell access

  6. 设置成功后,git客户端输入git init

  7. git add .

  8. git commit -m "first commit"

  9. 关联远程地址 git remote set-url origin ssh地址

  10. git push origin master

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐