The Pokemon Sylveon

Skylie Ivory

git-identity

by Eryn Raine, published

A small tool that I wrote to ensure I can blame the correct headmate.

A bit ago (July 2026), I wrote a tool called git-identity. It had a simple job, provide a quick way to switch between different identities (name & email pairs). Why would I do this? Well when you’re more than one, it becomes kinda important (at least to me), to keep track of who did what. While I won’t say that the others here are incompetent developers who introduce 10 new bugs in every commit, but I also won’t say they’re the best. Now if you were to ask them about me, they’d probably say the same thing, that I may or may not introduce 10 new bugs in every commit.

So after that short backstory, now time to talk a bit about git-identity. It’s simply a shell script (more specifically Nushell) that provides the following local subcommands:

  • list: List all available identities
  • switch: Switch identity
  • whoami: Print the current identity
  • coauthor: Print co-authored-by git-trailer

Additionally, git-identity allows being configured with an external provider of identity (currently PluralKit) to synchronize the current git identity against and verify it:

  • precommit: Enforce external identity matches current git identity
  • sync: Synchronizes current git identity against external identity

There’s not much to it. The script loads JSON files located in $XDG_CONFIG_HOME/git-identity/identities/ and extracts a .name and .email field from them. From there, it calls git-config. It isn’t particularly extravagant but it solved a problem that we had and I see that as perfectly fair. For external providers, there’s a config.json specifying the external provider parameters. For PluralKit, we have:

{
  "identity_command": "git identity whoami pluralkit",
  "pk_id": "_____"
}

Then, each member has a .pk_id field as well. And to round off my little spiel, my own identity file:

{
  "name": "Eryn Raine Vineyard",
  "email": "vineyard+eryn@sivory.net",
  "pk_id": "_____"
}

If you want to learn more, probably just visit the repository.

Cheers and have a lovely day~, Eryn Raine