Unable to push git repo to Heroku, despite valid SSH keys

后端 未结 4 1745
花落未央
花落未央 2021-02-03 13:44

There are lots of stack articles citing the same error message as I am getting.

I went through the entire heroku setup doc on another computer and everything worked perf

4条回答
  •  逝去的感伤
    2021-02-03 14:37

    Okay, I was able to solve it. Several of these answers were helpful. It seem that two things had happened.

    First, based on this article the ssh keys had gotten confused. This was resolved by deleting the .ssh directory (of course this removed all the credentials for other things that use .ssh, but those can be recreated later):

    heroku keys:clear
    ssh-add -D #to remove all ssh identities
    ssh-keygen -t rsa -C "email@gmail.com" -f  ~/.ssh/id_rsa_heroku
    ssh-add ~/.ssh/id_rsa_heroku
    heroku keys:add ~/.ssh/id_rsa_heroku.pub    
    

    Secondly, based on an answer to this article the app name had somehow changed during the process of troubleshooting the ssh keys. The app name had to be manually edited in /repository_folder/.git/config

    To get the correct app name I logged into heroku.com on the web and then updated the config file:

    it's contains

    [remote "heroku"]
        url = git@heroku.com:my_new_app_name.git
        fetch = +refs/heads/*:refs/remotes/heroku/*
    

    Thanks to all that posted suggestions! I am so happy to finally be on my way to a new app!

    --UPDATE--

    I have to rerun this command every time I reboot the computer. I can add it my .profile or whatever, but thought it was worth a note.

提交回复
热议问题