Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git using wrong email address when talking to Heroku

git clone [email protected]:myapp.git

Results in a "myoldemailaddress not authorized to access myapp"

myoldemailaddress was an email address I was using on an old heroku account, but it seems to be stuck using it, I can use my new one.

I've removed the .heroku directory, and regenerated it, it has the correct user name and password, I can see my apps listed I've uploaded my key (I've regenerated my several times now) ssh-keygen -t rsa -C mynewaddress

I uninstalled and reinstalled heroku on a different user in the same machine it works just fine.

Something about my account has my old address, but I can't figure out where.

like image 339
David Avatar asked Jun 04 '10 17:06

David


People also ask

How do I link my Heroku account to GitHub?

Enabling GitHub Integration You can configure GitHub integration in the Deploy tab of apps in the Heroku Dashboard. To configure GitHub integration, you have to authenticate with GitHub. You only have to do this once per Heroku account. GitHub repo admin access is required for you to configure automatic GitHub deploys.

Is Heroku Git public?

No, the code is not public. Do not confuse GIT with GITHUB. When you deploy to heroku the repository is private to the owner and the added collaborators.

How do you push changes from GitHub to Heroku?

To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.

How do I deploy my site on Heroku using GitHub or Git?

Open the Deploy tab and scroll to the “Deployment method” section. Next, Select GitHub as the method. It will show a “Connect to GitHub” option where we can provide our GitHub repository. If you are doing it for the first time, Heroku will ask permission to access your GitHub account, accept it.


2 Answers

In case you still need an answer to this, the problem is that you probably have an old ssh key loaded in your ssh-agent.

To check your currently loaded keys, use the following command:

ssh-add -L 

First remove that key from the agent with (remember sudo):

sudo ssh-add -d 

Then, add the new key (the one with yournewemailaddress) with

ssh-add /path/to/your/private/key/file 

This should fix the problem.

like image 156
Juan Avatar answered Oct 14 '22 15:10

Juan


I solved the same problem with the following steps:

  1. deleted the application on heroku

  2. generated new keys with

ssh-keygen -t rsa -C myNewEmail

  1. uploaded new keys with

heroku keys:add

  1. recreated and pushed the application

some steps may be optional (like deleting the application) but this worked!

E/

like image 31
mekdigital Avatar answered Oct 14 '22 16:10

mekdigital