Blog
Notes on git identities, SSH keys and GitHub accounts, from the people building Hats.
-
GitHub Noreply Email for Git Commits: Set It per Account
Set your GitHub noreply email as user.email per account and folder, so your real address never leaks into commits. Copy-paste configs inside.
-
Git Push Wrong GitHub Account Over HTTPS: Fix osxkeychain
Git push uses the wrong GitHub account over HTTPS? Erase the osxkeychain entry, then scope credentials per repo or switch to SSH. Fix it now.
-
Which GitHub Account Is Git Using? 4 Checks Before You Push
Check which GitHub account git will use before you push: commit email, SSH key, gh session and signing, with the exact commands.
-
Git insteadOf Wrong SSH Key: Find the URL Rewrite
Git push using the wrong SSH key? A global url insteadOf rule may rewrite your remote. Find it, confirm the key, and scope it to one folder.
-
Fix Wrong Email in Git Commits (Amend, Rebase, Force-Push)
Committed with the wrong email? Fix one commit with --amend --reset-author or many with rebase --exec, and push safely with --force-with-lease.
-
Git Hook to Check user.email Before Every Commit
Block commits made with the wrong email using a pre-commit hook. Copy the script, share it with core.hooksPath, and know what hooks cannot catch.
-
Multiple SSH Keys for GitHub: Fix the Wrong Key (IdentitiesOnly)
Fix SSH using the wrong key for GitHub. Set one Host alias per account with IdentitiesOnly yes, then verify with ssh -T. Copy the config.
-
gh auth switch for Multiple GitHub Accounts: What It Misses
gh auth switch changes the active account for your whole machine, not per repo. See what it misses and how to pin the right account per folder.
-
Git includeIf: Different Email per Folder (and the Traps)
Set a different git email per folder with includeIf in two minutes. Fix the trailing-slash trap and cover SSH, gh and signing too.
-
GitHub Unverified Commits With Multiple Accounts: Fix
Commits marked Unverified on GitHub? Find whether the key or email is wrong, then sign with the right key per account and per folder.
-
Git Push Permission Denied to the Wrong GitHub Account: Fix
Git says permission denied to the wrong GitHub account? Find which SSH key or token it used, pin the right one per folder, and stop it for good.
-
Multiple GitHub Accounts on One Mac: A Setup That Holds
Use two or more GitHub accounts on one Mac: per-folder git identity, SSH keys, gh and signing, and how to stop pushing as the wrong account.