Skip to content

Marina Mele's site

Reflections on family, values, and personal growth

Menu
  • Home
  • About
Menu

How to access multiple Heroku accounts from one Computer

Posted on February 7, 2014October 1, 2015 by Marina Mele

Today I run into some trouble when I tried to access another Heroku account from my computer. After some research, I discovered the heroku-accounts plugin, which completely solved my problem! 🙂

Let’s see how it works…

The pluguin heroku-accounts manages multiple Heroku accounts for you. Assuming you have the Heroku toolbelt installed, you can install this pluguin with the command:

$ heroku plugins:install https://github.com/heroku/heroku-accounts.git

Then, you can configure each of your accounts. Let us start with an account named work:

$ heroku accounts:add work --auto

and then, you’ll have to enter the corresponding Heroku credentials. This creates a new private Key.

As indicated by the message on your terminal, in the file ~/.ssh/config you will see the following:

Host heroku.work
  HostName heroku.com
  IdentityFile /PATH/TO/PRIVATE/KEY
  IdentitiesOnly yes

Finally, to be able to push correctly our app to Heroku, we also need to change the Git configuration. In the .git folder of our app, edit or create a file named config and change the substring in the url from heroku.com to heroku.work, where we wrote the name of our account. Therefore, the final url in that file is:

[remote "heroku"]
     url = git@heroku.work:name-of-you-app.git

In a similar way, you can create another account, which we call personal:

$ heroku accounts:add personal --auto

We can list the accounts we have defined by:

$ heroku accounts

which returns

personal
work

Finally, once we have our accounts set we can move from one account to the other with:

$ heroku accounts:set work
$ heroku accounts:set personal

However, we need to be in the directory where exists the .git file to do this.

If you want to know which account is active, list the accounts and an * will appear on your active account. For example, if you have the personal account active:

$ heroku accounts
* personal
work

Hope it was useful! 🙂

Leave a Reply Cancel reply

You must be logged in to post a comment.

Categories

  • Personal Growth and Development
  • Mindful Parenting and Family Life
  • Productivity and Time Management
  • Mindfulness and Wellness
  • Values and Life Lessons
  • Posts en catalĂ 
  • Other things to learn

Recent Posts

  • Overcoming Regrets: Finding the Strength to Move Forward
  • Thinking Outside the Box: Creative Problem-Solving with Critical Thinking
  • Assertiveness: A Crucial Skill for Children’s Personal Growth
  • Els nens no son responsables de les emocions dels altres
  • Children are not responsible for other people’s emotions

RSS

  • Entries RSS
Follow @marina_mele
  • Cookie Policy
  • Privacy Policy
©2023 Marina Mele's site | Built using WordPress and Responsive Blogily theme by Superb
This website uses cookies to improve your experience. If you keep navigating through this website, we'll assume you're ok with this, but you can opt-out if you wish.Accept Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT