gitmailmap(5) — Linux manual page

NAME | SYNOPSIS | DESCRIPTION | SYNTAX | NOTES | EXAMPLES | SEE ALSO | GIT | COLOPHON

GITMAILMAP(5)                  Git Manual                  GITMAILMAP(5)

NAME         top

       gitmailmap - Map author/committer names and/or E-Mail addresses

SYNOPSIS         top

       $GIT_WORK_TREE/.mailmap

DESCRIPTION         top

       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)), it is used to map
       author and committer names and email addresses to canonical real
       names and email addresses.

SYNTAX         top

       The # character begins a comment to the end of line, blank lines
       are ignored.

       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 <[email protected]>

       The more complex forms are:

           <[email protected]> <[email protected]>

       which allows mailmap to replace only the email part of a commit,
       and:

           Proper Name <[email protected]> <[email protected]>

       which allows mailmap to replace both the name and the email of a
       commit matching the specified commit email address, and:

           Proper Name <[email protected]> Commit Name <[email protected]>

       which allows mailmap to replace both the name and the email of a
       commit matching both the specified commit name and email address.

       Both E-Mails and names are matched case-insensitively. For
       example this would also match the Commit Name <[email protected]>
       above:

           Proper Name <[email protected]> CoMmIt NaMe <[email protected]>

NOTES         top

       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.

EXAMPLES         top

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

           Joe Developer <[email protected]>
           Joe R. Developer <[email protected]>
           Jane Doe <[email protected]>
           Jane Doe <jane@laptop.(none)>
           Jane D. <jane@desktop.(none)>

       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 <[email protected]>
           Jane Doe <[email protected]>
           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 <[email protected]>
           Jane Doe <[email protected]> <jane@laptop.(none)>
           Jane Doe <[email protected]> <jane@desktop.(none)>

       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 <[email protected]>
           Jane <[email protected]>

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

           Joe R. Developer <[email protected]>
           Jane Doe <[email protected]> <jane@laptop.(none)>
           Jane Doe <[email protected]> <jane@desktop.(none)>
           Joe R. Developer <[email protected]> Joe <[email protected]>
           Jane Doe <[email protected]> Jane <[email protected]>

SEE ALSO         top

       git-check-mailmap(1)

GIT         top

       Part of the git(1) suite

COLOPHON         top

       This page is part of the git (Git distributed version control
       system) project.  Information about the project can be found at
       ⟨http://git-scm.com/⟩.  If you have a bug report for this manual
       page, see ⟨http://git-scm.com/community⟩.  This page was obtained
       from the project's upstream Git repository
       ⟨https://github.com/git/git.git⟩ on 2024-06-14.  (At that time,
       the date of the most recent commit that was found in the
       repository was 2024-06-12.)  If you discover any rendering
       problems in this HTML version of the page, or you believe there
       is a better or more up-to-date source for the page, or you have
       corrections or improvements to the information in this COLOPHON
       (which is not part of the original manual page), send a mail to
       [email protected]

Git 2.45.2.492.gd63586         2024-06-12                  GITMAILMAP(5)

Pages that refer to this page: git(1)git-blame(1)git-check-mailmap(1)git-for-each-ref(1)git-help(1)git-shortlog(1)