---
title: "How to Add Multiple GitHub Accounts to your Mac"
url: https://monogram.io/blog/how-to-add-multiple-github-accounts-to-your-mac
description: "Sometimes work requires you to use multiple GitHub accounts. For example, you might have a personal account and a client account. Whatever the reason, you might need to use multiple GitHub accounts on your Mac."
date: 2022-10-01
authors: ["Claudio", "Leonardo"]
---

# How to Add Multiple GitHub Accounts to your Mac

**Published:** Oct 01, 2022 | **Authors:** Claudio, Director of Engineering; Leonardo, Senior Engineer | **Categories:** Engineering

---

Sometimes work requires you to use multiple GitHub accounts. For example, you might have a personal account and a client account. Whatever the reason, you might need to use multiple GitHub accounts on your Mac.

Agency life requires you to work with multiple clients, each of them having their own GitHub internal policies and requirements. Probably most will just give you access during the development phase, but others will insist on creating a new GitHub account for you. This is a good practice, but it can be a bit annoying to have to switch between accounts all the time. Here’s how to add multiple GitHub accounts to your Mac.

## Step 1: Create a new SSH key for each of your GitHub accounts

The first thing you need to do is to create a new SSH key for each of your GitHub accounts. You can do this by following the [instructions on GitHub’s website](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent), or simply by running the following command in your terminal:

```bash
ssh-keygen -t ed25519 -C "agency-email@example.com" -f "~/.ssh/agency-github-username"
```

-C is the comment; in this case we use the email address to identify the GitHub account. Your file is generated and saved in ~/.ssh

Repeat the process for each of your client's GitHub account, so that you have a separate SSH key for each of them.

```bash
ssh-keygen -t ed25519 -C "agency-email@example.com" -f "~/.ssh/client-github-username"
```

## Step 2. Add the SSH key to the ssh-agent

Once you have created the SSH key(s), you need to add it to your SSH agent. You can do this by running the following command:

```bash
ssh-add --apple-use-keychain ~/.ssh/agency-github-username
ssh-add --apple-use-keychain ~/.ssh/client-a-github-username
```

--apple-use-keychain is a flag that tells the ssh-agent to use the macOS Keychain to store the SSH key.

## Step 3. Add the SSH key to your GitHub account

Now that you have created the SSH key and added it to the ssh-agent, you need to add it to your GitHub account. You can do this by following the instructions on GitHub’s website -- should always be up to date, but at high level follow these simple steps:

Copy the SSH key to your clipboard with the following command:

```bash
pbcopy < ~/.ssh/client-a-github-username.pub
```

Navigate to [https://github.com/settings/keys](https://github.com/settings/keys)

Click on New SSH key

Paste the SSH key into the Key field and add a title for the key. (Keep the Key type as "Authentication Key".)

Click Add SSH key

## Step 4: Modify your SSH config file

Now that you have added the SSH key to your GitHub account, you need to modify your SSH config file (~/.ssh/config).

Here's an example of what your SSH config file should look like:

```bash
Host *
	AddKeysToAgent yes
	UseKeychain yes

# Monogram GitHub
Host github.com
	HostName github.com
	User git
	IdentityFile ~/.ssh/id_ed25519

# GitHub Client-A
Host github.com-client-a
	HostName github.com
	User git
	IdentityFile ~/.ssh/client-a-github-username

# GitHub Client-B
Host github.com-client-b
	HostName github.com
	User git
	IdentityFile ~/.ssh/client-b-github-username

# GitHub Client-C Enterprise Account
Host github.client-c-enterprise.cloud
	HostName github.client-c-enterprise.cloud
	User git
	IdentityFile ~/.ssh/client-c-github-username
```

## Step 5: Clone your repositories

Now that you have set up your SSH config file, you can clone your repositories. You can do this by running the following command:

```bash
git clone git@github.com-client-a:<client-a-org-name>/<repo-name>.git
```

One thing to note is that you need to use the `github.com&lt;-client-a&gt;` even though they're both hosted on GitHub. This is because the SSH config file tells the SSH client to use the `IdentityFile` for `github.com-client-a`, and the host is an alias for github.com defined in the HostName field.

Your main agency account is set up by default, so you don't need to specify anything after `github.com` in the host when cloning your agency's or personal repositories.

## Contact Us

[Build what comes next](https://monogram.io/#contact) | Email: [hello+llm@monogram.io](mailto:hello+llm@monogram.io)

Provide your contact details and claim a time to meet. We'll help you do the rest.

Monogram is an Applied AI Studio based in Atlanta that designs and deploys production AI systems — connecting models, data, workflows, and enterprise software to automate real work.

The contact form collects: name, email, company, estimated budget (USD), a project description, and how you heard about Monogram.

Not sure where to start? Tell us what you're trying to automate or build — we'll help you figure out where AI fits.


---

**More content:** [Home](/.md) | [About](/about.md) | [Work](/work.md) | [Engineering](/engineering.md)

Monogram helps companies, organizations, and firms adopt AI by designing and building proof of concepts (POCs), MVPs, intelligent workflows, and production-ready AI applications.

Website designed and developed by [Monogram](https://monogram.io)