Windows configures git public key to read and write remote git projects

  1. First, the Windows computer needs to download and install git:

Download and install directly from the official website: https://git-scm.com/download/win

  1. add public key
ssh-keygen -t rsa -C "[email protected]"

Note: This [email protected]is consistent with the email address registered by github

Then press Enter all the way, the generation is complete

Enter in the console:

start .

Open the file browser, there is a folder under the current path .ssh:
insert image description here
there will be two files after opening:

  • id_rsa: private key, do not copy to other places
  • id_rsa.pub: public key, you can copy the content to github for authentication

Use notepad or vscode to open id_rsa.pubthe file, copy the content inside, go to github, find in the settings: add ssh key, then paste it in and save it

  1. Use git locally

Just enter the git command directly on the command line, and operations such as push and pull do not need to be verified

Guess you like

Origin blog.csdn.net/weixin_35757704/article/details/132217644