[Git] git adds SSH Key operation

  1. Generate SSH key
$ ssh-keygen -t rsa -C "[email protected]"
  1. To copy the public key,
    you can find the .ssh directory in the user's home directory. There are two files id_rsa and id_rsa.pub in it. These two are the secret key pair of SSH Key. id_rsa is the private key and cannot be leaked out. key, you can tell anyone with confidence.
    insert image description here
  2. Configure the SSH Key
    avatar in Gitlab>settings>SSH Keys.
    insert image description here
    Generally, this step is enough, but sometimes there will be situations where the user name and password are still required to be entered after setting the SSH Key, and the operation in step 4 is required.
  3. configuration
git config --global credential.helper store 

Then the operation pull/push will allow you to enter the username and password, and enter it for the first time. The next time you operate pull/push, you don't need to enter the username and password.

Guess you like

Origin blog.csdn.net/zhoulizhu/article/details/113247776