Git: Permission denied (publickey) fatal - Could not read from remote repository. while cloning Git repository

后端 未结 30 1817
青春惊慌失措
青春惊慌失措 2020-12-12 10:10

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://<         


        
相关标签:
30条回答
  • 2020-12-12 10:29

    fix for hub cli tool:

    • git config --global hub.protocol https for long term
    • git remote add OOPS https://github.com/isomorphisms/go.git && git push OOPS for immediate fix

    This 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.

    0 讨论(0)
  • 2020-12-12 10:29

    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.

    0 讨论(0)
  • 2020-12-12 10:31

    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.

    0 讨论(0)
  • 2020-12-12 10:33

    Github(or Bitbucket) can't find your ssh key in their server.

    Just add your key in your account setting.

    0 讨论(0)
  • 2020-12-12 10:34

    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.

    0 讨论(0)
  • 2020-12-12 10:35

    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
    
    0 讨论(0)
提交回复
热议问题