How to handle multiple heroku accounts with GIT

Following the answer from HERE it is becoming a simple task.

  1. Go to ~/.ssh
  2. If you don’t have a config file – create one with name config
  3. Add the following to the newly created config
Host heroku.work
  HostName heroku.com
  IdentityFile ~/.ssh/id_heroku_work_rsa
  IdentitiesOnly yes

id_heroku_work_rsa is the generated ssh key file using the command from as shown HERE:

Go to your project .git folder and find the config file there. Open it and change remote heroku to look like this:

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

You may also like...