I've just published a reference for anyone using git while trans, explaining how to hide or remove your deadname in git repositories

Please share ❤️

https://code.curly.kiwi/2026/02/27/using-git-while-trans/

Using git while trans | Brooke's code blog

A guide for hiding or removing your deadname in git repositories.

@nerdnz this would have been really nice to have in like 2019. asynchronously thank you

@mszegedy I was just about to post something similar, including the year :D

Really helpful, thank you @nerdnz

@nerdnz thanks for this! it's nice to know the situation has improved since when we had to do it, and your writeup is super readable and will doubtless help people
@nerdnz the actual reason why my website jackiejude.me isn't open source is because the git history contains my deadname oops
@nerdnz thats a really good writeup! simple, easy to follow, and clear about the pros and cons of each approach.
@nerdnz Also useful for people that are less than happy with sharing their real name online. Thanks!
@nerdnz Was assuming there was going to be commit-rewriting: would that change all of your commit-history's dates? How well would this work for a repository you didn't own (or otherwise has branch- or similar "protection" enabled)?

While I'm not trans, seeing solutions like this always makes curious on details, N-order effects, etc..

@ferricoxide The history rewriting approach I've mentioned doesn't change commit dates - I wanted to make sure I found something that preserved as much metadata as possible

Rewriting the history like that is unlikely to be viable on work projects or open source ones with lots of collaborators, but it is a good option to know about for things like personal projects

@nerdnz

Meant commit IDs. I've seen attempts at removing committer information from projects end up re-IDing everything. Thus my curiosity.

I've been lucky enough that I've generally been able to not use name-based emails for public projects.
@ferricoxide Yeah rewriting history in _any_ way means the old commits are gone and replaced with fresh new ones. Commit metadata like author name is used for generating commit hashes so there's no way to modify it without reconstructing a brand new commit. But it is possible to do that in a way that preserves the commit date part of the metadata
Makes sense that the only way to retroactively rewrite history in a repository is to, indeed, retroactively rewrite all the relevant commits and force-push them. At least you'll generally have to do it only once in your lifetime, right? ...Right?
@csolisr Depends on how many times you change your name I suppose. In my experience, force pushing a change like this in any particular project is either completely unviable or not a problem at all. I'm not sure there are all that many cases where it's somewhere in between
@nerdnz I'm a collaborator (and cis ally) on a big open source project with a lot of non-technical committees who would not be able to handle it if we rewrote history on them. We also have a good amount of people who contributed both before and after transition. Do you think it would still be helpful to inform/suggest the mailmap thing?

@maltelau Yeah history rewriting is usually only really viable on personal projects and the like

Being aware of mailmap as an option is certainly better than not being aware. It definitely does have its own downsides, which I hope I laid out clearly, but it's something individual contributors could make a call on based on their own priorities

@nerdnz @maltelau As a maintainer of a project that can't have history rewritten and that might have deadname-credited commits in history, it's important to make sure anyone who asks for mailmap treatment understands the part about how it does make them stand out, and does make an immutable record mapping their deadname to their current name, before just adding them to mailmap and potentially making things worse.
@nerdnz
Oof, this sucks. Sorry to anyone who has to rewrite git history.
@nerdnz this is one of the biggest issues in git imo, identity is considered immutable, which is just not realistic
@SRAZKVT Yeah, it's a safety issue and it's really not treated like one. Hard to go back in time and change that early design decision though, can't rewrite that history unfortunately

@nerdnz and when the history is shared with other people it leads to problems

there is really just no win

@nerdnz Cool!...oh you recommend filter-repo

Careful with filter-repo

It tries to trash your repository and then remove all the safety backups.

That's why it's so adamant about "run it on a fresh clone!!!!!!!!!!!!". What if there IS no fresh clone? What if there is no remote? Then it falls over horribly, and leaves you with a broken project.

filter-branch is better.

@nerdnz At least, it used to do that back when we tried it a couple years ago. I immediately swore it off and started using FILTER_BRANCH_SQUELCH_WARNING=1 instead.