Can't push my code to Heroku: Permission denied <public key> fatal: Could not read from remote repository

13,445

I really should have searched harder before posting this question as I found the answer in another question with an almost identical name.

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

Share:
13,445
Daft
Author by

Daft

I enjoy gin

Updated on June 15, 2022

Comments

  • Daft
    Daft almost 2 years

    I'm trying to push my code to Heroku with this line:

    git push heroku master
    

    But I keep getting the following error/message:

    Warning: Permanently added 'heroku.com,50.85.49.333' <RSA> to the list of known hosts. 
    Permission denied <public key>
    fatal: Could not read from remote repository
    
    Please make sure you have the correct access rights and the repository exists.
    

    I have uploaded my key:

    heroku keys:add ~/.ssh/id_rsa.pub
    

    And set my remote to the git url:

    git remote set-url heroku [email protected]:project-name.git
    

    And still no luck. Could anyone point out the problem?

    I am following THIS short tut.