---
title: How to manage multiple Github accounts
description: This article is useful for the developer who is dealing with multiple git accounts. Heady has you covered with a simple step by step guide.
image: https://www.heady.io/hubfs/Assets%20June%202020/Blog%20Images/Group%20132%20Copy@2x.png
---

**NEW LAUNCH: **Weill Cornell Medicine's [Maya app](https://www.heady.io/work/maya) is now available for Android!<https://www.heady.io/work/lg-electronics>

![Close Bar](https://www.heady.io/hubfs/Group%2040042.svg)

[![Heady_Logo_Web-01 (1)](https://www.heady.io/hs-fs/hubfs/Heady_Logo_Web-01%20(1).png?width=130&height=78&name=Heady_Logo_Web-01%20(1).png) ](https://www.heady.io/)

 This article is useful for the developer who is dealing with multiple git accounts. The following steps are the list of command which will help you when dealing with multiple git accounts.

[Software Engineering](https://www.heady.io/blog/tag/software-engineering)

# How to manage multiple Github accounts

![Saish Chachad](https://www.heady.io/hubfs/Assets%20June%202020/Blog%20Images/Icons%20-%20Profile@2x-1.png)

Author ** Saish Chachad **

Published On ** Aug 25, 2020 **

Share this article

- <https://twitter.com/intent/tweet?original_referer=&url=&source=tweetbutton&text=Check%20out%20this%20blog%20from%20Legility:%20How%20to%20manage%20multiple%20Github%20accounts%20here%20https://www.heady.io/blog/how-to-manage-multiple-github-accounts>
- <http://www.facebook.com/share.php?u=https://www.heady.io/blog/how-to-manage-multiple-github-accounts>
- <https://www.linkedin.com/shareArticle?mini=true&url=https://www.heady.io/blog/how-to-manage-multiple-github-accounts>

![featured_github](https://www.heady.io/hubfs/Assets%20June%202020/Blog%20Images/Group%20132%20Copy@2x.png)

Share this article

- <https://twitter.com/intent/tweet?original_referer=&url=&source=tweetbutton&text=Check%20out%20this%20blog%20from%20Legility:%20How%20to%20manage%20multiple%20Github%20accounts%20here%20https://www.heady.io/blog/how-to-manage-multiple-github-accounts>
- <http://www.facebook.com/share.php?u=https://www.heady.io/blog/how-to-manage-multiple-github-accounts>
- <https://www.linkedin.com/shareArticle?mini=true&url=https://www.heady.io/blog/how-to-manage-multiple-github-accounts>

## Introduction

This article is useful for the developer who is dealing with multiple git accounts.

The following steps are the list of command which will help you when dealing with multiple git accounts. Simply copy and paste the commands on your terminal and check the code from your repository.

###### Step 1

## Checking for existing SSH keys

1. Open Terminal app.
2. Enter ls -al ~/.ssh to see if existing SSH keys are present: List the files in your .ssh directory, if they exist.
3. Check the directory listing to see if you already have a public SSH key.
4. By default, the filenames of public keys are one of the following:

id_dsa.pub  
id_ecdsa.pub  
id_ed25519.pub  
id_rsa.pub

Tip: If you don’t have an existing public and private key pair, or don’t wish to use any of that are available to connect to GitHub, then generate a new SSH key.

 

###### Step 2

## Create new SSH

ssh-keygen -t rsa -b 4096 -C "personalEmail@gmail.com"  
ssh-keygen -t rsa -b 4096 -C "workEmail@work.com"  
ssh-keygen -t rsa -b 4096 -C "freelanceEmail@work2.com"

 

###### Step 3

## Add your private SSH key to the ssh-agent and store your passphrase in the keychain

ssh-add -K ~/.ssh/id_rsa  
ssh-add -K ~/.ssh/id_rsa_work  
ssh-add -K ~/.ssh/id_rsa_work2

 

###### Step 4

## See the list of added SSH

ssh-add -l

This will list the fingerprints of all identities.

 

###### Step 5

## Add a new SSH key to your account

$ pbcopy < ~/.ssh/id_rsa.pub  
# Copies the contents of the id_rsa.pub file to your clipboard

This will list the fingerprints of all identities.

**Tip:** If pbcopy isn’t working, you can locate the hidden .ssh folder by opening the file in your favorite text editor and copying it to your clipboard.

1. Go to your Github account.
2. In the upper-right corner of any page, click your profile photo, then click **Settings**
   
   ![1_Zz-0nINK5t3TrX0KIz2rYw](https://www.heady.io/hs-fs/hubfs/Assets%20June%202020/Blog%20Images/1_Zz-0nINK5t3TrX0KIz2rYw.png?width=227&name=1_Zz-0nINK5t3TrX0KIz2rYw.png)
3. In the user settings sidebar, click **SSH and GPG keys.**
   
   ![1_IthaEYgcQlscRMqUhxxOVw](https://www.heady.io/hs-fs/hubfs/Assets%20June%202020/Blog%20Images/1_IthaEYgcQlscRMqUhxxOVw.png?width=261&name=1_IthaEYgcQlscRMqUhxxOVw.png)
4. Click **New SSH key** or **Add SSH key**.
   
   ![1_MdWSb_kdNpbSjDZ_3Bc39A](https://www.heady.io/hs-fs/hubfs/Assets%20June%202020/Blog%20Images/1_MdWSb_kdNpbSjDZ_3Bc39A.png?width=900&name=1_MdWSb_kdNpbSjDZ_3Bc39A.png)
5. In the **Title** field, add a descriptive label for the new key. Paste your key into the **Key** field.
   
   ![1_-gpWpnwo_0Ang-WMgVrY1A](https://www.heady.io/hs-fs/hubfs/Assets%20June%202020/Blog%20Images/1_-gpWpnwo_0Ang-WMgVrY1A.png?width=900&name=1_-gpWpnwo_0Ang-WMgVrY1A.png)
6. Click **Add SSH key.**
   
   ![1_GffKqrrl8EX8qsH_ERXthA](https://www.heady.io/hs-fs/hubfs/Assets%20June%202020/Blog%20Images/1_GffKqrrl8EX8qsH_ERXthA.png?width=159&name=1_GffKqrrl8EX8qsH_ERXthA.png)
7. Follow the same steps to copy **id_rsa_work** and **id_rsa_work2** key onto your work and freelance accounts.

 

###### Step 6

## Make changes in the config file

1. Go to .ssh folder.
2. Open config file in any textEditor.
3. If config file is not present, create one.

cd ~/.ssh  
touch config

 

###### Step 7

## Copy and paste this text into the config file

# Personal GitHub account  
Host github.com  
HostName **github.com**  
User git  
AddKeysToAgent yes  
UseKeychain yes  
IdentityFile **~/.ssh/id_rsa**

# Work VSTS account  
Host vs-ssh.visualstudio.com-**work**  
HostName **vs-ssh.visualstudio.com**  
User git  
AddKeysToAgent yes  
UseKeychain yes  
IdentityFile **~/.ssh/id_rsa_work**

# Work2 GitHub account  
Host github.com-**work2**  
HostName **github.com**  
User git  
AddKeysToAgent yes  
UseKeychain yes  
IdentityFile **~/.ssh/id_rsa_work2**

In my case, my personal and freelance accounts are on GitHub, and my work account is on VSTS.

 

###### Step 8

## Clone Repo (Freelance Github Account)

Copy the clone URL from Github (from work2 account) and modify as below.

***Original url:***

git clone git@github.com:(Repo path).git

***Modified url:***

git clone git@github.com-**work2**:(Repo path).git

Paste this (modified) URL onto the terminal.

 

###### Step 9

## Configure User attributes

Go into the repository folder from terminal and paste this command.

git config user.name "work2"  
git config user.email "freelanceEmail@work2.com"

 

###### Step 10

## Repeat steps 8 and 9 for other (personal and work) accounts

### Cheers 🥂

---

 

## Extra Commands for HELP

1.Delete all identities.

ssh-add -D

2. For more help, use the following commands.

ssh -help  
ssh-add -help

![Group 132 Copy@2x](https://www.heady.io/hs-fs/hubfs/Assets%20June%202020/Blog%20Images/Group%20132%20Copy@2x.png?width=620&height=475&name=Group%20132%20Copy@2x.png)

## Interested in a career at Heady?

Excellent! We are always looking for great talent.

[ Learn More ](https://www.heady.io/careers)

![app-clips_1](https://www.heady.io/hubfs/Assets%20June%202020/Blog%20Images/app-clips_1.png)

![app-clips_2](https://www.heady.io/hubfs/Assets%20June%202020/Blog%20Images/app-clips_2.png)

## Interested in a career at Heady?

Excellent! We are always looking for great talent.

[ Learn More ](https://www.heady.io/careers)

###### LET'S TALK IT OUT.

## Figuring out your next step? We're here for you.

## Or drop us a line.

[hello@heady.io](mailto:hello@heady.io)

Our emails are *(almost)* as cool as our digital products.

[![Heady_Logo_Web-01 (1)](https://www.heady.io/hs-fs/hubfs/Heady_Logo_Web-01%20(1).png?width=75&height=45&name=Heady_Logo_Web-01%20(1).png) ](https://www.heady.io/)

Your phone will break before our apps do.

###### Brooklyn

20 Jay St

Suite 1018

Brooklyn, NY 11201

###### Mumbai

WeWork Vikhroli

Mumbai, India

###### Online

- <https://www.linkedin.com/company/heady/>
- <https://www.instagram.com/makeitheady/?hl=en>
- <https://twitter.com/makeitheady>

###### Hit us up!

[hello@heady.io](mailto:hello@heady.io) [646.480.0489](tel:6464800489)

- <https://www.linkedin.com/company/heady/>
- <https://www.instagram.com/makeitheady/?hl=en>
- <https://twitter.com/makeitheady>

![Badges-24](https://www.heady.io/hubfs/Badges-24.png)

![Badges-24](https://www.heady.io/hubfs/Badges-24.png)

###### Brooklyn

20 Jay St

Suite 1018

Brooklyn, NY 11201

###### Mumbai

WeWork Vikhroli

Mumbai, India

###### Online

- <https://www.linkedin.com/company/heady/>
- <https://www.instagram.com/makeitheady/?hl=en>
- <https://twitter.com/makeitheady>

---

© 2026, Heady LLC.

[About](https://www.heady.io/about)[Careers](https://www.heady.io/careers)[Newsroom](https://www.heady.io/newsroom)[Media Kit](https://www.heady.io/media-kit)[Privacy Policy](https://www.heady.io/privacy-policy)