Setting up SSH Keys in Gitlab

Posted by : at

Category : git

Ads by Google

Setting up ssh keys in Gitlab

For gitlab

$ KEY=yourname-gitlab && ssh-keygen -t rsa -b 4096 -f ~/.ssh/$KEY -C "$KEY"

This will create a public ssh key,Now open config file:

$ nano ~/.ssh/config

and save the host details :

 Host yourname-gitlab
 IdentityFile ~/.ssh/yourname-gitlab

Now copy the ssh signed rsa public key by:

$ cat ~/.ssh/

Now paste this ssh key in Gitlab settings page

After saving the ssh key, just set the remote url using the ssh url provided for the repo:

$ git remote set-url origin [email protected]:yourname/yourrepo.git

That’s it, Now you don’t have to enter password everytime for a push

ggpush and ggpull works too !!

It should work, For any Suggestions or Doubts, please comment. Enjoy :D

Ads by Google