I am unable to clone a Git repository, and getting this error:
krishna.soni@KRISHNACHANDRAS /c/Projects $ git clone http://stage.abc.com:10088/pqr
http://<
I've had this issue on a Mac - while I setup SSH correctly to access my Git repository, after restart (and some time the Mac was on a standoff), all my credentials were removed. Apparently, for some reason the pub key was set to 644 which caused it to be removed from the keychain. To readd:
chmod 600
the public keyssh-add ~/.ssh/[your private key]
- this should display that identity has been added. The key file you want is the one without the .pub extension.ssh-add -l
should show you newly added identityedit: apparently MacOS has tendency of removing keys - after downloading the High Sierra update (but I've not installed it yet) my key has been removed and I've had to add it again via ssh-add
For me, when i wanted to clone from my repository, i had the same message noticed before "Permission denied (publickey) fatal: Could not read from remote repository". The solution for my case is to not use sudo before clone That's it.
I had a similar problem on linux. I solved the problem by logging into the github server and creating a deploy key. That's under settings for the repository. Then, I copied and pasted my public key (which is usually in ~/.ssh/id_rsa.pub, but your configuration might be different). There is a check box to give this key write access. Click on it (unless you are using git to deploy only, in which case, don't click on it).
Remove remote origin
git remote remove origin
Add HTTP remote origin
You need to create a new ssh key by running ssh-keygen -t rsa
.
You can try adding your ssh key to your private keychain. It worked for me
ssh-add -K ~/.ssh/[your-private-key]