windows11 git install SSH key

Why does git want SSH keys

Git is an open source distributed version control system that can handle any project efficiently and agilely, and is used to help manage Linux kernel development. It is very necessary to generate an ssh, which can establish a secure encrypted connection between the computer and the code server;

In other words, in fact, if you do not set the ssh public key, you must enter your account password every time you submit the code. If you don’t need a password, then everyone can push code to your code warehouse? After setting up the public key, when your machine communicates with github, github can identify you as a trusted user through the public key.

Specific installation steps

  1. Download and install git
    (1) Download from the official website: https://git-scm.com/downloads
    (2) Then install directly next;
    (3) Verify whether the installation is successful: Enter the command git version in PowerShell , and the following figure will appear;
    insert image description here

  2. PowerShell generates an SSH key
    (1) Enter the command: ssh-keygen -t rsa -C "xxxxxx@xxx";
    (2) Press Enter three times, it is best to press Enter directly, saving the trouble of entering the password;
    (3) Finally Generate the ssk key in the .ssh folder of the user on the c drive;
    insert image description here
    (4) View the content of the .ssh/id_rsa.pub file and get the public key. The command is as follows: cat .ssh/id_rsa.pub
    insert image description here

  3. Copy the key to the corresponding git warehouse platform, such as gitcode of csdn
    insert image description here

Guess you like

Origin blog.csdn.net/yanceyxin/article/details/127340180