Contributing Code Anonymously
This guide covers the coding setup after you create your anonymous GitHub account. If you are still deciding whether you need this kind of separation, read Protecting your privacy first.
This setup helps make sure your anonymous repositories do not leak your real name, email address, or SSH key, and that commits are signed with your anonymous identity.
If you do not set up this SSH configuration, GitHub may bam your new account, because it sees that you’re using the same series of SSH key attempts across multiple accounts when pushing commits.
Do not:
- ❌ Put anonymous identity information in global
~/.gitconfig. - ❌ Reuse your regular SSH key. Generate a dedicated key for this account.
- ❌ Paste your private key anywhere. Share only the public key (
.pub). - ❌ Use GitHub CLI for this account setup (it can default to your primary account).
Hide your email in commits
Section titled “Hide your email in commits”When this helps: Use GitHub’s noreply address when you contribute with your normal GitHub account but do not want a real email or legal name showing in commit metadata. Commits store both user.email and user.name, so set both to values you are fine exposing publicly (for example your GitHub username). Use --global only for that everyday account—not alongside the local anonymous identity below.
When this is optional: If you use the per-repository [user] settings in Configure your anonymous SSH setup, skip this—your commits already use your anonymous email and name, and you must not put that identity in global ~/.gitconfig.
Settings: In Settings → Emails, enable Keep my email addresses private and copy your @users.noreply.github.com address. Optionally enable Block command line pushes that expose my email so GitHub rejects pushes when commits still use a private address from your account (details).
git config --global user.name "YOUR_PUBLIC_OR_GITHUB_USERNAME"git config --global user.email "YOUR_NOREPLY@users.noreply.github.com"Setting your commit email address
Configure your anonymous SSH setup
Section titled “Configure your anonymous SSH setup”-
Generate a dedicated SSH key
Option A (recommended): Generate an SSH key pair in 1Password if you use it. Follow 1Password’s docs to generate a key, enable the SSH agent, and enable Git commit signing.
Option B: Generate and load a key manually:
Terminal window ssh-keygen -t ed25519 -C "github_ac" -f ~/.ssh/github_aceval "$(ssh-agent -s)"ssh-add ~/.ssh/github_ac -
Add the key to your GitHub account
-
Copy your public key:
Terminal window cat ~/.ssh/github_ac.pub -
In GitHub, open Settings -> SSH and GPG keys and add the key as an SSH authentication key.
-
On the same page, add the same public key again as a signing key.
-
-
Set up your SSH config
Add one of these blocks to
~/.ssh/config:## OPTION A: If you use 1Password for your SSH keysHost github.com-acHostName github.comUser gitIdentityAgent "~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock"IdentityFile ~/.ssh/github_ac.pubIdentitiesOnly yes## OPTION B: If you are using a regular SSH keyHost github.com-acHostName github.comUser gitIdentityFile ~/.ssh/github_acIdentitiesOnly yes -
Configure your repository’s local Git identity
Edit your repository’s local
.git/config. Do not put this in global~/.gitconfig.Replace
YOUR_NEW_ANONYMOUS_EMAILandYOUR_NEW_ANONYMOUS_USERNAMEwith your anonymous email and username.Update
YOUR_NEW_ANONYMOUS_USERNAME/ActivistChecklist.gitwith your fork of the repo.[user]email = YOUR_NEW_ANONYMOUS_EMAILname = YOUR_NEW_ANONYMOUS_USERNAME[user]signingkey = ssh-ed25519 AAAACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[gpg]format = ssh# Uncomment the next 2 lines if you use 1Password for SSH signing#[gpg "ssh"]# program = "/Applications/1Password.app/Contents/MacOS/op-ssh-sign"[commit]gpgsign = true[remote "origin"]url = git@github.com-ac:YOUR_NEW_ANONYMOUS_USERNAME/ActivistChecklist.gitfetch = +refs/heads/*:refs/remotes/origin/*[branch "main"]remote = originmerge = refs/heads/mainvscode-merge-base = origin/mainFor
signingkey, copy the full contents of your public key file (~/.ssh/github_ac.pub). Never use your private key. -
Update your remote to use the SSH alias
Terminal window cd PATH_TO_REPOgit remote remove origingit remote add origin git@github.com-ac:YOUR_NEW_ANONYMOUS_USERNAME/ActivistChecklist.gitgit remote -v# Should show github.com-ac, not github.com or https://ssh -T git@github.com-ac# Should say "successfully authenticated" -
Test the setup
Make a test commit to verify your identity and signing setup:
Terminal window git checkout -b feature/test-commitgit commit -am "Test commit"git log# Verify author name and email are your anonymous onesgit push -u origin feature/test-commitThen open the repository in your browser and confirm the commit shows up under your anonymous account.