Git Bash Here

Gitlab or Gitee provides Git services based on the SSH protocol. Before using the SSH protocol to access the repository, you need to configure the SSH public key of the account or repository.

You can generate the sshkey as follows:

ssh-keygen -t rsa -C "[email protected]"  
# Generating public/private rsa key pair...
Copy the code

Note: [email protected] here is only the name of the generated sshkey and does not constrain or require a specific mailbox to be named. Most of the tutorials on the live web are about the use of mailbox generation, the original intention of the first is just for easy identification so the use of mailbox.

Press Enter three times as prompted to generate an SSH key. To obtain your public key, check the contents of ~/.ssh/id_rsa.pub

cat ~/.ssh/id_rsa.pub
# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc....
Copy the code

Copy the generated SSH key and choose Manage > Deploy Public Key > Add Deploy Public Key on the repository home page to add the generated public key to the repository.