【Vegas原创】vscode使用github


1, vscode打开terminal,生成RSA密钥,并查看蜜月

PS D:codeSQL> git init
Reinitialized existing Git repository in D:/code/SQL/.git/
PS D:codeSQL> git config --global user.name amadeus
PS D:codeSQL> git config --global user.email vegas_lee@163.com
PS D:codeSQL> ssh-keygen -t rsa -C "vegas_lee@163.com"
Generating public/private rsa key pair.
Enter file in which to save the key (C:Usersvegas/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your public key has been saved in C:Usersvegas/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:JTEfU8+j6+dxrYqoiCy+jbUNHUXCQGvF3rY/6FFjC5E vegas_lee@163.com
The key's randomart image is:
+---[RSA 3072]----+
|  .o+o .o o..    |
|    ooo .+ o o   |
|   o. .E. o   +  |
|  .  ..o.o   . . |
|     ...S+  .    |
|    . ..+ o  .  .|
|   o . .o.  . . o|
|..+.+. ..+ o  .+ |
|.=+o..oo. o o+o  |
+----[SHA256]-----+
PS D:codeSQL> cat ~/.ssh/id_rsa.pub
ssh-rsa me5Aomus6IQmsIRT+tGpWsSSuKhe7WrJhPQmuDl vegas_lee@163.com
PS D:codeSQL>

image


2,打开github网站,进入仓库,进入setting,设置deploy keys,将id_rsa.pub中的内容粘贴进去即可。

image


3,terminal绑定本地文件夹和GitHub仓库,并做连接测试:

PS D:codeSQL> git remote add ztsql git@github.com:vegaslee/sql.git
PS D:codeSQL> ssh -T git@github.com
Hi vegaslee/sql! You've successfully authenticated, but GitHub does not provide shell access.


4,做一次推送

PS D:codeSQL> git push --force ztsql master 
Enumerating objects: 110, done.
Counting objects: 100% (110/110), done.
Delta compression using up to 8 threads
Compressing objects: 100% (107/107), done.
Writing objects: 100% (110/110), 68.98 KiB | 255.00 KiB/s, done.
Total 110 (delta 18), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (18/18), done.
To github.com:vegaslee/sql.git
 * [new branch]      master -> master
PS D:codeSQL>
喜欢请赞赏一下啦^_^
原文地址:https://www.cnblogs.com/amadeuslee/p/15405898.html