Heroku 'Permission denied (publickey) fatal: Could not read from remote repository' woes

前端 未结 14 1585
故里飘歌
故里飘歌 2020-12-12 08:57

I\'ve searched around for many hours on end looking to a solution to my seemingly easy-to-fix problem. It\'s not that my search turned up nothing, it\'s that my search turne

相关标签:
14条回答
  • 2020-12-12 09:03

    I had a similar heroku ssh error that I could not resolve.

    As a workaround, I used the new heroku http-git feature (http transport for "heroku" remote instead of ssh). Details here: https://devcenter.heroku.com/articles/http-git

    (Short version: if you have a project already setup the standard way, run heroku git:remote --http-init to change "heroku" remote to http.)

    A good quick work around if you don't have time to fix/troubleshoot an ssh issue.

    0 讨论(0)
  • My way on Windows 8

    1. Add a directory with ssh-keygen to the system PATH variable, usually C:\Program Files (x86)\Git\bin

    2. Open CMD, go to C:\Users\Me\

    3. Generate SSH key ssh-keygen -t rsa

      Enter file in which to save the key (//.ssh/id_rsa): .ssh/id_rsa (change a default incorrect path to .ssh/somegoodname_rsa)

    4. Add the key to Heroku heroku keys:add

      Select a created key from a list

    5. Go to your app directory, write some beautiful code

    6. Init a git repo git init git add . git commit -m 'chore(release): v0.0.1

    7. Create Heroku application heroku create

    8. Deploy your app git push heroku master

    9. Open your app heroku open

    0 讨论(0)
  • 2020-12-12 09:13

    I'd like to add another solution since I didn't see it here. My problem was that heroku was linking to the wrong url (since I kept playing around with url names). Editing the remote url solved my problem:

    git remote set-url heroku <heroku-url-here>
    
    0 讨论(0)
  • 2020-12-12 09:15

    SO So So simple solution , go to c:/Users/user_name/.ssh/ and delete all pub / private key pairs , this way heroku will generate keys for you.

    0 讨论(0)
  • 2020-12-12 09:16

    you need to create a new ssh key by typing the following - ssh-keygen -t rsa

    Then you need to add: - heroku keys:add

    Then if you type - heroku open

    The problem has been solved.

    It worked for me anyway, you could give it a try...

    0 讨论(0)
  • 2020-12-12 09:17

    I got the same error, and because I have 4 ssh-keys, so I tried follow:

    ssh-keygen -t rsa
    heroku keys:add
    

    then, four options show:

    1) github_rsa.pub
    2) id_boot2docker.pub
    3) id_rsa.pub
    4) sshkey.pub
    

    I choose 3), the newest one

    Then, I fix the error.

    0 讨论(0)
提交回复
热议问题