- Open local Git bash and run the following command to generate SSH public and private key pairs
Ssh-keygen -t rsa -c '[email protected]' then press Enter (the -c parameter is your email address)
- Then open the ~/.ssh/id_rsa.pub file (~ indicates the user directory, for example C:\Users\Administrator on my Windows) and copy the contents
- Open GitLab, go to Profile Settings–>SSH Keys– >Add SSH Key, 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, click Add Key button
- Operation is completed