Follow steps shown below to generate an SSH key and add it to your GitLab:
- Create SSH key
Open your bash terminal and enter the following command: ssh-keygen -t rsa -b 2048
All options leave empty or as given by default (e.g. file in which the ssh key is saved or passphrase)
- Preview the generated SSH key
cat ~/.ssh/id_rsa.pub
- Select and copy the SSH key. Use text editor if needed.
- Add SSH key to your GitLab
Open GitLab in web browser. Clink on the drop menu next to your avatar (top right corner). Select "Preferences". Select "SSH Keys" (menu on the left). Paste SSH key to "Key" text box and "Add key".