GITMAILMAP(5)

πŸ’Œ GITMAILMAP(5) β€” the glow-up guide for your git identities πŸ’Œ

okay so this is gitmailmap, bestie β€” it's a page from the git manual family, and no cap, it's the single most underrated little file in your repo. it's literally the "everyone gets their real name back" machine. let's get into it 🫢


✨ NAME ✨

gitmailmap β€” maps author/committer names and/or E-Mail addresses πŸ’…

like, it takes all your chaotic historical identities and says "no babe, THIS is who you are."


✨ SYNOPSIS ✨

$GIT_WORK_TREE/.mailmap

that's it. that's the whole vibe. one file. πŸ”₯


πŸŽ€ DESCRIPTION πŸŽ€

okay so here's the tea: if the file .mailmap exists at the toplevel of the repository, or at the location pointed to by the mailmap.file or mailmap.blob configuration options (see git-config(1)), git uses it to map author and committer names and email addresses to canonical real names and email addresses.

iconic. she's a translator. she's a glow-up filter for your commit history. ✨


πŸ¦‹ SYNTAX πŸ¦‹

the # character begins a comment to the end of line, and blank lines are just ignored (we respect the silence πŸ™ˆ).


🌸 the simple form

in the simple form, each line in the file consists of the canonical real name of an author, whitespace, and an email address used in the commit (enclosed by < and >) to map to the name. for example:

Proper Name <commit@email.xx>

so chill. so easy. one line and suddenly everyone has a real name again πŸ’–


🌈 the more complex forms

🧚 email-only replacement

<proper@email.xx> <commit@email.xx>

which allows mailmap to replace only the email part of a commit. name stays, email gets fixed. lowkey elegant.

πŸ‘‘ name + email replacement

Proper Name <proper@email.xx> <commit@email.xx>

which allows mailmap to replace both the name and the email of a commit matching the specified commit email address. the full package deal πŸŽ€

πŸ’€ the "match both" version

Proper Name <proper@email.xx> Commit Name <commit@email.xx>

which allows mailmap to replace both the name and the email of a commit matching both the specified commit name and email address. very "i know exactly which commit you are" energy. main character behavior.


⭐ case-insensitivity, because she's generous

both E-Mails and names are matched case-insensitively. for example this would also match the Commit Name <commit@email.xx> above:

Proper Name <proper@email.xx> CoMmIt NaMe <CoMmIt@EmAiL.xX>

the way that just WORKS πŸ˜­πŸ’œ


πŸ”₯ NOTES πŸ”₯

⚠️ git does not follow symbolic links when accessing a .mailmap file in the working tree. this keeps behavior consistent when the file is accessed from the index or a tree versus from the filesystem.

so yes, symlinks are being ignored on purpose, and honestly? it's giving consistency. don't fight her. 🫢


πŸ“ EXAMPLES πŸ“

okay this is the fun part, sit down, grab a snack.

say your history contains commits by two authors, Jane and Joe, whose names appear in the repository under several forms:

Joe Developer <joe@example.com>
Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com>
Jane Doe <jane@laptop.(none)>
Jane D. <jane@desktop.(none)>

messy!! a whole identity crisis in your git log 😭

now suppose that Joe wants his middle name initial used, and Jane prefers her family name fully spelled out. a .mailmap file to correct the names would look like:

Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com>
Jane Doe <jane@desktop.(none)>

note that there's no need to map the name for <jane@laptop.(none)> to only correct the names. however, leaving the obviously broken <jane@laptop.(none)> and <jane@desktop.(none)> E-Mails as-is is usually not what you want. 🫠 a .mailmap file which also corrects those is:

Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com> <jane@laptop.(none)>
Jane Doe <jane@example.com> <jane@desktop.(none)>

look at that. clean. pristine. the emails got adopted. πŸ’–


finally, let's say that Joe and Jane shared an E-Mail address, but not a name β€” e.g. by having these two commits in the history generated by a bug reporting system. i.e. names appearing in history as:

Joe <bugs@example.com>
Jane <bugs@example.com>

a full .mailmap file which also handles those cases (an addition of two lines to the above example) would be:

Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com> <jane@laptop.(none)>
Jane Doe <jane@example.com> <jane@desktop.(none)>
Joe R. Developer <joe@example.com> Joe <bugs@example.com>
Jane Doe <jane@example.com> Jane <bugs@example.com>

ate. no crumbs. history fully fixed. πŸ”₯πŸ‘‘


πŸ’… SEE ALSO πŸ’…

go say hi, she's the one who actually shows you the mapping. iykyk πŸ¦‹


🧚 GIT 🧚

part of the git(1) suite πŸŽ€


and that's the whole page bestie, you're officially a mailmap expert now πŸ’œ

this little fairy tale came to you courtesy of Git 2.56.0, dated 2026-09-27 β€” it's GITMAILMAP(5), and she's logging off πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from