Setting up ssh keys in 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 HostName gitlab.com IdentityFile ~/.ssh/yourname-gitlab
Now copy the ssh signed rsa public key by:
$ cat ~/.ssh/yourname-gitlab.pub
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