jqheart jqheart - 4 months ago 60
Git Question

Gitlab key format issue

I am facing a strange situation where I am using gitlab account to handle my code. I am using ssh protocol to access the repo. I am able to pull the code but I am receiving the following error while I try to push the code. This could be something silly on my side. But I have the keys stored in my gitlab profile and able to use it to pull the code.

Error :

$ git push origin master
key_load_public: invalid format
Enter passphrase for key '/c/Users/username/.ssh/id_rsa':
Access denied.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Any help or suggestions will be great. Thanks in advance.


Finally I have been able to resolve this issue and I am posting it for other users. If the keys generated by putty is not helping you to access the gitlab repo, try generating the keys from gitbash terminal using the command ssh-keygen and save the files in .ssh folder of your user account.

The linux style key generation made my life easy as I was trying to generate key in windows environment with putty keygen.

Hope this helps somebody.