Few days ago, I was trying to git pull origin master from our master branch so I can get the latest version to develop on. Upon entering the command, this blankly (and blinkally) stared at me:
My-MacBook-Pro:branch_name loop$ git pull origin master git@domain's password:
For the life of me, I have never seen this before. This particular branch worked fine just six days ago!
I tried various things:
Made sure that my public key on Gitlab is the same as my github_rsa.pub, and it indeed was the same.
Uncommented sshd_config's to PasswordAuthentication no
Checked /var/log/authd.log for errors relating to SSH, but nothing relevant came up
None of those fixes helped.
For some reason, Git stopped recognizing my public and private key (which was originally named github_rsa.pub and github_rsa respectively).
Eventually, I broke my silence, and my lovely French coworker Allan told me there's an easy fix - generate a new public/private key pair just for Gitlab.
- In your favorite command line interface, generate a new SSH key:
ssh-keygen -t rsa -C "email@example.com" Note: For this scenario, when it prompted me to enter a password, I left it blank, since this key is simply for internal use.
- Dump the contents:
- Finally, copy the contents and add to Gitlab.
Pretty simple stuff. Let me know if this helped you in anyway - it seems this issue is quite common with Gitlab.