- Open the local git bash, use the following command to generate the ssh public key and private key pair,
ssh-keygen -t rsa -C '[email protected]'
and then press Enter all the way (-C parameter is your email address)
-
Then open the /.ssh/id_rsa.pub file ( representing the user directory, for example, my windows is C:\Users\Administrator), and copy the contents
-
Open gitlab, find Profile Settings->SSH Keys->Add SSH Key, and paste the content copied in the previous step into the text box corresponding to Key, set a name for this sshkey in the text box corresponding to Title, and click Add key Button
- At this point, all the steps of gitlab configuration ssh key are completed, and we can happily use the ssh protocol to pull and submit the code.
- Try to pull the code and submit the code again, there should be no need to enter a password