Anonymous git identity manager — commit anonymously, impersonate GitHub users, and manage signing behavior per-repo.
gitanon on Anonymize current repo
gitanon off Restore global identity and re-enable signing
gitanon as <user> Commit as another GitHub user
gitanon whoami Show current repo identity
gitanon hook Run gitanon-aware git hooks
gitanon overrides your local git config (never global) so you can:
- Go anonymous — set a local anonymous identity (
userwith an empty email), disable signing, mark the repo with a config flag - Impersonate anyone — fetch a GitHub user's public profile and commit as them (name + noreply email)
- Restore cleanly — undo all overrides and re-enable signing in one command
- Hook integration — ships a
mysystem.gitanonconfig flag that your hooks can check to skip signing enforcement
See the full Installation Guide for all methods including Nix, go install, and building from source.
# Quick install via go
go install github.com/yzua/gitanon@latest
# Or via nix
nix run github:yzua/gitanon
# Or add to your flake inputs
# inputs.gitanon.url = "github:yzua/gitanon";# Anonymize current repo
cd my-repo
gitanon on
# ✔ Anonymous mode in my-repo
# Check identity
gitanon whoami
# Repo: my-repo
# Name: user
# Email: (none)
# Signing: false
# Key: (none)
# AnonMode: on
# Scope: local (override)
# Commit anonymously (with hooks that honor `mysystem.gitanon`)
git add .
git commit -m "chore: anonymous work"
# Impersonate another GitHub user
gitanon as octocat
# ✔ Committing as The Octocat <583231+octocat@users.noreply.github.com> in my-repo
# Restore your real identity and re-enable signing
gitanon off
# ✔ Restored global identity in my-repo| Command | Aliases | Description |
|---|---|---|
gitanon on |
anon |
Set anonymous identity (user, empty email, signing disabled) |
gitanon off |
back, undo |
Restore global identity and re-enable GPG signing |
gitanon as <user> |
— | Fetch GitHub user and commit as them |
gitanon whoami |
— | Show current repo identity |
gitanon hook <name> |
— | Run a hook (pre-commit, pre-push) that respects anon mode |
gitanon completion <shell> |
— | Generate shell completions (bash, zsh, fish, powershell) |
gitanon version |
— | Print version |
gitanon as octocat
- Calls
GET https://api.github.com/users/octocat(unauthenticated, public endpoint) - Fetches: login, numeric ID, display name
- Sets local git config:
user.name= "The Octocat"user.email= "583231+octocat@users.noreply.github.com"commit.gpgSign= falsetag.gpgSign= falsepush.gpgSign= falseuser.signingKey= ""mysystem.gitanon= true
The noreply email format is <id>+<login>@users.noreply.github.com, which is GitHub's native anonymous email format.
gitanon sets a config flag that your hooks can detect:
# Check if anon mode is active
if [ "$(git config --bool --get mysystem.gitanon || echo false)" = "true" ]; then
echo "Anonymous mode — skipping signing enforcement"
exit 0
fiOr use gitanon hook directly in your hooks:
#!/bin/sh
# .git/hooks/pre-push (or global hooksPath)
gitanon hook pre-pushSee docs/hooks.md for detailed setup.
gitanon uses mysystem.gitanon in local git config as its marker:
| Value | Meaning |
|---|---|
true |
Anonymous mode active — hooks should skip signing enforcement |
| absent | Normal mode — hooks enforce signing as usual |
This flag is only set in local config (git config --local), never global.
just all # fmt + vet + lint + test + build
just test # Run tests
just lint # Run golangci-lint
just cover # Generate coverage report
nix develop # Enter dev shell (go, golangci-lint, just, git)You could do all this manually, but gitanon:
- Batches 7 config changes into one command
- Fetches GitHub user IDs for noreply email construction
- Provides a standard flag for hook integration
- Restores signing correctly (the thing you always forget)
- Works the same across shell environments