Managing two GitHub accounts on Windows means three layers: Git Credential Manager storing one login per repository, per-folder commit identity via .gitconfig, and a desktop client that doesn't fight you about sign-ins. The first two layers are standard Git-for-Windows configuration (useHttpPath, includeIf "gitdir/i:", Windows Credential Manager). For the third layer you have a choice: sign out/in rotation in official GitHub Desktop — or GITmaxed, the multi-account Git client for Windows where both accounts stay signed in and each repository is bound to its account.
How Windows stores everything (the map)
| Layer | Where it lives on Windows | Two-account rule |
|---|---|---|
| Git + Git Credential Manager | Installed with Git for Windows | GCM saves logins into Windows Credential Manager |
| Saved GitHub credentials | Credential Manager entries (git:https://github.com) | Enable useHttpPath → one login per repository instead of per host |
| Commit identity | %USERPROFILE%\.gitconfig + per-folder includes | includeIf "gitdir/i:C:/Work/" switches name/email automatically |
| SSH keys | %USERPROFILE%\.ssh\ | One key per account; IdentitiesOnly yes in the SSH config |
| Desktop GUI | GitHub Desktop / GITmaxed | Desktop: one GitHub.com login. GITmaxed: many, per-repository binding |
One-time configuration (terminal layer)
# Git Bash — one credential per repository
git config --global credential.https://github.com.useHttpPath true
# one identity per folder tree (case-insensitive Windows form)
cat >> ~/.gitconfig <<'EOF'
[includeIf "gitdir/i:C:/Work/"]
path = ~/.gitconfig-work
[includeIf "gitdir/i:C:/Personal/"]
path = ~/.gitconfig-personal
EOF
# ~/.gitconfig-work
[user]
name = Work Name
email = me@company.com
# ~/.gitconfig-personal
[user]
name = Personal Name
email = me@example.com
First push per repository asks once — sign in as the account that owns it. After that, Windows Credential Manager remembers that repository's login separately from the other account's.
Day-to-day management in Windows
- See stored logins: Control Panel → User Accounts → Credential Manager → Windows Credentials → entries starting with
git:. - Fix a wrong push identity: delete the entry (
cmdkey /delete:LegacyGeneric:target=git:https://github.comorgit credential-manager erase), push again, sign in correctly. - OAuth lands in your browser: keep two browser profiles, one per account, and switch the active profile before approving a sign-in — otherwise the wrong account gets bound.
- Verify any repo in seconds:
git config --show-origin --get user.email(who commits) ·ssh -T git@github.com(who pushes over SSH) ·gh auth status --active(CLI).
GitHub Desktop on Windows: the one-account limit
Official GitHub Desktop on Windows signs into one GitHub.com account (plus one Enterprise account). There is no second-account button; the feature request (#3707) is still open with no release date — a January 2026 community implementation was declined in favor of an internal one. Windows users therefore manage GUI multi-accounting three ways:
| Option | Effort | Simultaneous? |
|---|---|---|
| Sign-out / sign-in rotation (Options → Accounts) | Low per switch, high over a week — remember Git name/email each time | No |
| SSH side-channel: Desktop signed into A, account B's repos cloned over SSH | Medium — key setup; B's repos lack Desktop's GitHub integration | Partially |
| GITmaxed | None — add accounts, pin repositories | Yes — all accounts in one window |
GITmaxed: the Windows client built for this
- Preferences → Accounts → Add GitHub.com account — repeat for work, personal, clients. No sign-out, no "existing account" warning.
- Repository → account picker — bind each repository to its account; the choice persists forever.
- Push / pull / PR — always authenticated as the bound account; commits authored with that account's identity. Removing one account revokes only its token.
GITmaxed follows GitHub Desktop's stable releases, so the interface you already know is unchanged — the multi-account layer is the only difference.
GitHub CLI on Windows
gh auth login --web --user work-login
gh auth login --web --user personal-login
gh auth switch --user personal-login
gh auth status
Fast for cloning and API work — but gh auth switch changes the CLI only; your per-folder Git config and repository credentials stay as configured.
Troubleshooting
| Symptom on Windows | Cause | Fix |
|---|---|---|
| Push rejected / "Repository not found" for a repo you can open in the browser | Credential Manager holds the other account's login | Erase the git: entry, push again, sign in as the owner (with useHttpPath on) |
| Commits show the wrong name/email | Folder doesn't match any includeIf rule (path/casing/symlink) | git config --show-origin --get user.email; open the repo via the configured path |
| Permission denied (publickey) | Wrong key offered or key not on that account | IdentitiesOnly yes; test with ssh -i KEY -o IdentitiesOnly=yes -T git@github.com |
| "Key already in use" | Same SSH key uploaded to both accounts | Generate a second key — GitHub requires one per account |
| Browser asks to sign into "the wrong" account during OAuth | Default browser profile is logged into the other account | Switch profile first, then approve |
| GitHub Desktop blocks a second login | Product limitation (one GitHub.com account) | Rotation, SSH side-channel — or GITmaxed for both at once |
Hygiene checklist
- Work and personal repositories never share a folder tree.
- Early on: check the commit author badge on github.com after each first push per repo.
- Tokens are per account, scoped minimally, stored only in Credential Manager.
- SSH keys have passphrases; one key per account, never reused.
- Know the account rules — one free personal account per person, plus enterprise/service/machine/paid variants (see Are Multiple GitHub Accounts Allowed? in this documentation).
Related questions answered (the same queries, one by one)
How do I switch between two GitHub accounts on Windows?
Terminal: nothing to switch — folder config picks the identity. Credentials: per-repository logins handled by GCM. GUI: GITmaxed has no global switch (repositories are bound individually); official Desktop requires sign-out/sign-in.
Where are GitHub credentials stored on Windows?
In Windows Credential Manager, via Git Credential Manager — entries like git:https://github.com, or per repository when useHttpPath is enabled.
Can GitHub Desktop on Windows use two accounts?
Not simultaneously — one GitHub.com account only. GITmaxed (Windows) keeps both signed in with per-repository binding.
Can I use gh auth switch on Windows?
Yes (CLI v2.40+, gh auth switch --user name) — it switches the CLI's active account, not your Git push credentials.
Why does Git keep using the wrong GitHub account?
Almost always the credential layer: the host-wide login wins because useHttpPath is off, or the stored per-repo login is stale. Erase and re-authenticate as shown in Troubleshooting.
Is GITmaxed free for Windows?
Yes — free, open-source, tracks GitHub Desktop's stable releases, multi-account support included.
No comments:
Post a Comment