GitHub Desktop Multiple Accounts: Keep Sign-In and Commit Identity Separate
If you use one GitHub account for work and another for personal projects, switching between them can be awkward. GitHub Desktop 3.7.0 adds support for signing in to multiple accounts on the same host and associating an account with each repository.
That solves a common authentication problem, but it does not set the name or email Git writes into your commits. Those are two separate decisions:
- Repository account: which signed-in account GitHub Desktop uses to access the remote repository.
- Commit author: the name and email recorded in commits created on your computer.
Keep both straight and you can use the right credentials for a push without accidentally stamping a work commit with a personal email, or vice versa.
What the repository account controls
GitHub Desktop's repository account association tells the app which signed-in account to use for GitHub API requests and HTTPS authentication for operations such as fetch, pull, and push. The feature supports multiple accounts on GitHub.com, GitHub Enterprise Server, and GHE.com.
It is a per-repository association, not a separate copy of the project and not a rule for commit authorship. If you have a personal account and a work account on GitHub.com, for example, the same Desktop installation can keep both signed in while using one for a work repository and the other for a personal repository.
Existing repositories are associated with the account you were already using on that host. If you only had one account, the update should keep that account association; you do not have to re-clone your repositories just to use the feature.
Choose an account while cloning or adding a repository
First, add both accounts in GitHub Desktop:
- On macOS, open GitHub Desktop > Settings > Accounts.
- On Windows, open File > Options > Accounts.
Use Add GitHub.com account for GitHub.com, or Add GitHub Enterprise account for an Enterprise host. The accounts pane groups Enterprise accounts by host. You can stay signed in to more than one account at a time.
When cloning from the GitHub tab, choose the account from the Account menu. Desktop lists repositories that the selected account can access, then associates the cloned repository with that account.
Cloning from a URL or adding a local repository works a little differently. Desktop checks which signed-in accounts on that host can access the repository:
| What Desktop finds | What to expect |
|---|---|
| One account can access it | Desktop assigns that account. |
| More than one account can access it | Desktop asks you to choose. |
| No account can access it | A local repository can be added without an account assignment. A private HTTPS clone cannot succeed without an account that has access. |
Public repositories are a special case: every signed-in account on the same host can access a public repository. If you have multiple accounts signed in, Desktop may ask which one to associate even though the repository is public. Choose the account you intend to use for the repository's future remote operations.
Change the account for an existing repository
You can change the association later; you do not have to remove and re-add the repository.
- Select the repository in GitHub Desktop.
- Open Repository > Repository settings.
- On the Remote pane, choose the account from the Account menu and save.
You can also right-click a repository in the repository list, open its Account submenu, and choose another signed-in account for the same host. The current assignment is marked with a check. If the assigned account is signed out, Desktop identifies it as signed out.
Signing out has a separate choice. Desktop can keep the repository assignments for when you sign in again, or clear them so that the next operation asks you which account to use. Keeping an assignment does not keep you authenticated: you still need to sign in again before Desktop can use that account.
Set commit authorship separately
The account assigned to a repository does not change the Git author name or email. GitHub Desktop uses Git configuration for that information:
- Global
user.nameanduser.emailvalues are defaults. - A repository can have its own author name and email that override the global values.
To inspect the values Git sees from a repository, run these read-only commands in that repository's terminal:
git config --show-origin --get user.name
git config --show-origin --get user.email
--show-origin helps identify which configuration file supplied each value. These commands do not change configuration. If you make commits in both work and personal repositories on the same computer, review the output in each repository rather than assuming the Desktop account picker also changed it.
You can set a repository-specific author identity in GitHub Desktop under Repository > Repository settings > Git Config. Choose Use a local Git config, then enter the name and email for commits in that repository. This leaves your global defaults in place for other projects. GitHub Desktop can warn before a commit if the configured email is not associated with the account you are currently signed in to, but treat the author settings as something to verify—not as an automatic account switch.
If you prefer the terminal, Git supports local configuration for the current repository. Be deliberate: a global setting changes the default for every repository, while a repository-local setting changes only the current repository. Avoid copying a personal email into a work repository, or changing the global value just to fix one project's attribution.
Troubleshoot the two identities independently
When something looks wrong, start with the operation that failed:
A push or fetch uses the wrong account. Check the repository's Account association in GitHub Desktop. Confirm the selected account is signed in to the repository's host and has access to that repository. Changing user.email will not fix remote authentication.
A push succeeds, but a commit has the wrong author. Check user.name and user.email for that repository, then set a local Git identity if needed. Switching the repository account will not rewrite the author information in commits that already exist.
Desktop asks you to pick an account for a public repository. That can be expected when multiple accounts are signed in to the repository's host: all of them can access a public repository, so Desktop cannot infer which account you want associated.
The account is listed but a remote operation still asks you to sign in. The repository may be assigned to an account that is signed out, or the account may no longer have access. Sign in again or assign another account that has access; do not treat the repository's Git author email as a credential.
Keep commit email privacy in mind
The author email is part of commit metadata. GitHub notes that the configured email can be visible in public commits. If you do not want to publish a personal address, use the GitHub-provided noreply address for the account and configure it for the relevant repository or as your global default.
Changing the configured email affects future commits; it does not rewrite the identity on commits you already made. If a past commit needs correction, changing account assignment or the current Git setting is not enough—those actions do not alter existing commit objects.
The safest routine is simple: pick the account that should authenticate to the remote, then separately verify the author name and email that should appear in the commit. Once you treat those as two controls, GitHub Desktop's multiple-account support becomes easier to use without mixing personal and work identities.