Skip to content

Instantly share code, notes, and snippets.

@Lysak
Created May 4, 2025 13:32
Show Gist options
  • Save Lysak/dea4dced5687b32513f858399ac3f627 to your computer and use it in GitHub Desktop.
Save Lysak/dea4dced5687b32513f858399ac3f627 to your computer and use it in GitHub Desktop.
bulk‐rewriting commit authors
install `pip install git-filter-repo`
### 1) Create a mailmap file
In your repo root, create e.g. `rewrite-mailmap.txt` with **Git’s mailmap syntax**, e.g.:
```
# Format: Proper Name <proper@email> <old@email>
Your New Name <[email protected]> <[email protected]>
```
### 2) Run git-filter-repo with --mailmap
```bash
# (–force is only needed if you’ve already filtered this repo before)
git filter-repo --mailmap rewrite-mailmap.txt --force
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment