Every time GitHub logs in, you need to enter your username and password and how GitHub configures SSH Key


Preface

Why do I need to enter my username and password every time I move in?

GitHub提供了两个地址;一种:https 另一种:SSH 
  1. When using https connection, you need to enter your username and password every time you need to.
  2. Use SSH connection, no need to enter a password, but need to bind the key generated by the local Git

1. Use https

每次需要输入一下用户名密码;

The code is as follows (example):

2. Use SSH

  1. Git software needs to be installed locally (you can download it from the app store or the official website, the official website download is slow).

  2. Open Git Bash software

Git

第一次使用的话输入如下:你的用户名跟email地址。
git config --global user.name "Your Name"
git config --global user.email  "Your Email"
完成上面后再输入如下:
ssh-keygen -t rsa -C "Your Email"
完成之后应该是需要回车两下,它会提示你文件保存到某个目录下。
在用户文件夹,你的用户名下会多出一个.ssh文件,打开后拷贝串

pub
Then follow the steps below and go back to vs. You will find that you don't need to enter the username and password.

Insert picture description here


Guess you like

Origin blog.csdn.net/hello_mr_anan/article/details/108390936