简体   繁体   中英

Cannot clone git repo

I am trying to collaborate on a project hosted on heroku. I have been invited via meldium.com and I have successfully registered my email adress to the project.

I received an email from heroku saying that I could clone the repo with the following command line:

$ git clone git@heroku.com:test-repo.git -o heroku

But everytime I try to clone the repo I get the following error message:

Warning: Permanently added the RSA host key for IP address 'XX.XX.XX.XXX' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

What I don't understand is that I received an email saying that a key had been added to my account and when I type heroku key I get this:

ssh-rsa AAAAB3NzaC...lhJB2r8hnD my-github-id@github.com

What have I done wrong?

Many thanks

If you're getting a public key error message then it's typically down to a mismatch between what ssh key you are presenting and what key Heroku has.

From your command line execute ssh -v git@heroku.com you're looking in here for a bit that looks like

debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/foobah/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: Authentication succeeded (publickey).

If the name of the key doesn't correspond to the public key you've added to Heroku then you'll need to either add the corresponding key to Heroku or switch the key that ssh uses for the heroku.com domain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM