Multiple heroku accounts Multiple heroku accounts git git

Multiple heroku accounts


You need to ensure that you are using the correct ssh key.

The way to do this (and the way the heroku accounts plugin prompts you) is to add a section to your ssh config file in ~/.ssh/config. For instance, for my work heroku account I have this in my ssh config:

Host heroku.work  HostName heroku.com  IdentityFile ~/.ssh/id_heroku_work_rsa  IdentitiesOnly yes

Now, and this is crucial, you need to make sure that your git remote is set up to use that same named host. In this case it is heroku.work. Normally it would be heroku.com if you were using heroku with only a single account.

So you'll need to edit the git remote (you can do this in the .git/config file of your repo on your machine). Change the file to look like:

 [remote "heroku"]   url = git@heroku.work:<appname>.git

Note the heroku.work, not heroku.com, and replace <appname> with the name of your app (aka your repo name) on heroku.


I solved this by using the heroku-accounts plugin

see here for instructions

http://martyhaught.com/articles/2010/12/14/managing-multiple-heroku-accounts/


You've got to be accepted as a collaborator on the project you don't own.

It works like this (using git) :

  1. The owner of the project goes to heroku's console for the project
  2. The owner adds the email address of the collaborator (the one that was used to register the collaborator's)
  3. The collaborator sets up his public security key in his account (if he didn't already)
  4. The collaborator adds and sets up the other project as another remote

And that should be all folks ; you just have to push on the other remote when deploying on the other app.