美文网首页
本地文件上传到GitHub(Part01,SSH添加到Githu

本地文件上传到GitHub(Part01,SSH添加到Githu

作者: 可爱多小姐 | 来源:发表于2019-01-20 16:58 被阅读0次
1.创建SSH Key

打开Shell(Windows下打开Git Bash),创建SSH Key:
$ ssh-keygen -t rsa -C "youremail@example.com"

TYH_LAB@DESKTOP-OFK7U34 MINGW64 ~/PycharmProjects/Mxonline (master)
$ ssh-keygen -t rsa -C yaqian_wang@qq.com
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/TYH_LAB/.ssh/id_rsa):
Created directory '/c/Users/TYH_LAB/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/TYH_LAB/.ssh/id_rsa.
Your public key has been saved in /c/Users/TYH_LAB/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:+Q+7ph5HXPA+n3gjw+yIGRffYaFzNN8QbkThPU2C4c8 yaqian_wang@qq.com
The key's randomart image is:
+---[RSA 2048]----+
|          . .+*..|
|           +.+ =.|
|            + O.o|
|         o o * =o|
|        S + = E o|
|         o = O o |
|        o = B *  |
|         B.* + . |
|       .=o+.o    |
+----[SHA256]-----+

输入命令后,一路回车,就可以得到公钥了。

2.将公钥上传到GitHub
进入GitHub

1.点击头像下的settings
2.SSH and GPG keys
3.点击NEW SSH
4.记事本打开id_rsa.pub,赋值公钥。


将公钥文件加入到GitHub

5.将公钥文件加入到GitHub


将公钥文件加入到GitHub
title随便取名字,点击add就ok啦。

作者:一个菜菜的程序媛,学习计算机中总是会踩到无数各种奇奇怪怪的坑,只是找个空间记录下来,互相学习,欢迎大佬的指教。公众号:可爱多小姐

相关文章

网友评论

      本文标题:本地文件上传到GitHub(Part01,SSH添加到Githu

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