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://<
fix for hub
cli tool:
git config --global hub.protocol https
for long termgit remote add OOPS https://github.com/isomorphisms/go.git
&& git push OOPS
for immediate fixThis error occurs with the hub
command line tool because of their wrong default hub.protocol
git-config value. They set repos to
git://github.com/schacon/ticgit.git
instead of what github actually accepts, namely https://github.com/schacon/ticgit.git
.
Reading LESS=+/"HTTPS instead" man hub
will explain where the above "long-term fix" command comes from.
I followed the steps detailed in Generating a new SSH key and adding it to the ssh-agent and
Auto-launching ssh-agent on Git for Windows.
In my case ~/.profile
file was not present in my Windows.
I had to create it, then added the script provided in the above link.
While cloning, I had a similar issue [ my ERROR: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights .. etc ]
-- I was using bitBucket/UBUNTU14.04 in my case, but ALREADY had a set of key files that I had previously generated AND I had changed the name of the files. I simply COPIED the files to the standard id_rsa & id_rsa.pub name format. I then re-ran the command with out issue.
OBTW: I could have also used the password prompt by using the HTTP style clone.
Github(or Bitbucket) can't find your ssh key in their server.
Just add your key in your account setting.
solution: On the server you are trying to clone to or push from cat ~/.ssh/id_rsa.pub Go to GitHub, settings, SSH and GPG Keys , New SSH key paste key.
For people that come here that are just trying to get the repository but don't care about the protocol (ssh / https), you might just want to use https instead of ssh (if it's supported).
So for example you use
git clone https://github.com/%REPOSITORYFOLDER%/%REPOSITORYNAME%.git
instead of
git clone git@github.com:%REPOSITORYFOLDER%/%REPOSITORYNAME%.git