天天看点

git ssh提交流程

  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
    git ssh提交流程
  4. 复制上述文件中的内容到gitee -->设置 -->ssh公钥
    git ssh提交流程
  5. 点击确定后,git客户端输入ssh -T [email protected],跳出的对话框输入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