Assumption
- Windows OS
Tools
- PowerShell
- Git
First thing first you have to install Git for desktop by following this link : https://git-scm.com/downloads
- Open Powershell (in administrator privilege)
- Generate the ssh-key with this command
ssh-keygen -t ed25519 -C "example@gmail.com"
After that ,the ssh-key values pair will be generated and located somewhere in
C:\Users\<Computer User name>\.ssh\id_ed25519
3. copy public key text in the file id_ed25519.pub which is located at
C:\Users\<Computer User name>\.ssh\id_ed25519.pub
4. then go to gitlab.com (if you have self-hosted GitLab server then use your self-hosted GitLab server instead of gitlab.com) then navigate to settings >> SSH keys
Ficture1: Profile dashboard
5. Paste the public key to the input textarea then click “Add key”
Figure2: GitLab public key textarea
6. Done you can use this command to check whether success or not
ssh -v git@<SELF-HOSTED URL> -p <PORT>
for example,
ssh -v git@gitlab.yourcompanyapp.com -p 2222