通过命令:

$ ssh-****** -t rsa -C "[email protected]"

 

Git 生成SSH Key

然后回车

 

Git 生成SSH Key

 

3,打开 Github-settings-SSH and GPG keys

Git 生成SSH Key

4,点击App Key

Git 生成SSH Key

5,创建仓库  

在Repository name填入testgit,其他保持默认设置,点击“Create repository”按钮,就成功地创建了一个新的Git仓库

Git 生成SSH Key

6,跟本地仓库进行关联

Git 生成SSH Key

7,运行命令

git remote add origin https://github.com/lololoa/a.git

Git 生成SSH Key

8,把本地库的内容推送到远程,使用 git push命令,实际上是把当前分支master推送到远程。

Git 生成SSH Key

 

9,由于远程库是空的,我们第一次推送master分支时,加上了 –u参数,Git不但会把本地的master分支内容推送的远程新的master分支,还会把本地的master分支和远程的master分支关联起来,在以后的推送或者拉取时就可以简化命令。推送成功后,可以立刻在github页面中看到远程库的内容已经和本地一模一样了,上面的要输入github的用户名和密码如下所示:

 

Git 生成SSH Key

 

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-16
  • 2022-01-21
  • 2022-12-23
  • 2021-11-20
猜你喜欢
  • 2021-06-04
  • 2021-07-15
  • 2022-01-06
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案