Can I use different Heroku credentials on different projects?

  • 2
  • Question
  • Updated 2 years ago
  • Answered
@heroku is it possible to have per-project credentials? If I wanted to push with different credentials than listed in ~/.heroku/credentials
Photo of wuputah


  • 11 Posts
  • 4 Reply Likes

Posted 7 years ago

  • 2
Photo of David Dollar

David Dollar, Official Rep

  • 17 Posts
  • 3 Reply Likes
Official Response
One other thing to be aware of is how to make SSH deal with multiple SSH keys for git pushes.

I create two files:


I then use this bash function to switch

ln -sf ~/.heroku/$1 ~/.heroku/credentials

My ~/.ssh/config has this in it:

User git
IdentityFile ~/.ssh/identity.heroku
IdentitiesOnly yes

So when I create remotes like

it is guaranteed to use a specific key for authentication.