Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrmehle/254281 to your computer and use it in GitHub Desktop.
Save jrmehle/254281 to your computer and use it in GitHub Desktop.
# How to setup multiple heroku accounts
# (assuming you already have one setup)
# make sure ~/bin is in your path
create ~/bin/hcred and populate it with the following:
1 #!/usr/bin/env ruby
2
3 `rm ~/.heroku/credentials`
4 `ln -s ~/.heroku/credentials_#{ARGV[0]} ~/.heroku/credentials`
chmod +x hcred
mv ~/.heroku/credentials ~/.heroku/credentials_personal
cd ~/.ssh
ssh-keygen -f another_id_rsa
(a password is not required - but can be nice)
heroku keys:add ~/.ssh/other_id_rsa.pub
enter your other heroku email address
enter your other heroku password
mv ~/.heroku/credentials ~/.heroku/credentials_other
hcred other # to switch to the other account
hcred personal # to switch to your personal account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment