Before you tell me to refer to the similar questions, I've literally tried all of their answers and did my own research online (even though I am new to this). When I try to push the latest changes to Heroku with
git remote add heroku git@heroku.com:reviews.git
and then
git push heroku master
I get the following:
Macintosh-84:reviews dk1552$ git push heroku master
! Your key with fingerprint 2c:4e:7b:df:02:7e:18:c8:2a:16:04:bc:59:5b:88:98
is not authorized to access reviews.
fatal: The remote end hung up unexpectedly
I've set up keys, removed them, changed them, etc. All my folders/files are in Users/Dennis/...
One file I am updating for example is located in: Users/Dennis/reviews/app/views/static_pages/about_us.html.haml
What do I need to do to fix this?
One time this happened to me and I realized that I (having multiple Heroku accounts) used one account to initialize the Git and another to push the changes. Obviously this would create issues with your public key.
If that's the case for you either remove the .git/.gitignore directories and re-initialize with your preferred account, or sign in with the Heroku account that you used to init the Git and push the changes using that one.
See https://stackoverflow.com/a/9070685/664833 and run
ssh-add -d
then try pushing again.Also try https://stackoverflow.com/a/8803103/664833 (create a new key-pair and add upload the public key to Heroku).
If you have mixed your accounts and run into this problem, an easy workaround is to invite the yourself as a collaborator under your other email to the heroku app.
I ran into a similar issue when I created another Heroku app in a directory where git already had a working remote to an existing repository in Heroku. I kept getting the exact same error message regarding the fingerprint. So what I was trying to do was to create another environment for my web application.
By issuing these commands I was able to push to the remote again. Note that the
keys:add
command gives a list of available public keys. Choose the correct key that is associated with the account you are going to use (that has the application associated to it).heroku keys:add
- Choose the correct public key from the list for uploading to Heroku.heroku accounts:set <account name>
Now try
git push heroku master
again and the problem should be gone.My setup uses the accounts add-on as well. and I've got several Heroku accounts configured on my machine.