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
- arch rolling: git 2.56.0-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms