blob: 06f4af93fe6213164350125cc8d19012e83df17d [file] [log] [blame]
Junio C Hamano7887f9b2021-01-25 23:32:331gitmailmap(5)
2=============
3
4NAME
5----
6gitmailmap - Map author/committer names and/or E-Mail addresses
7
8SYNOPSIS
9--------
10$GIT_WORK_TREE/.mailmap
11
12
13DESCRIPTION
14-----------
15
16If the file `.mailmap` exists at the toplevel of the repository, or at
17the location pointed to by the `mailmap.file` or `mailmap.blob`
18configuration options (see linkgit:git-config[1]), it
19is used to map author and committer names and email addresses to
20canonical real names and email addresses.
21
22
23SYNTAX
24------
25
26The '#' character begins a comment to the end of line, blank lines
27are ignored.
28
29In the simple form, each line in the file consists of the canonical
30real name of an author, whitespace, and an email address used in the
31commit (enclosed by '<' and '>') to map to the name. For example:
32--
33Proper Name <commit@email.xx>
34--
35
36The more complex forms are:
37--
38<proper@email.xx> <commit@email.xx>
39--
40which allows mailmap to replace only the email part of a commit, and:
41--
42Proper Name <proper@email.xx> <commit@email.xx>
43--
44which allows mailmap to replace both the name and the email of a
45commit matching the specified commit email address, and:
46--
47Proper Name <proper@email.xx> Commit Name <commit@email.xx>
48--
49which allows mailmap to replace both the name and the email of a
50commit matching both the specified commit name and email address.
51
52Both E-Mails and names are matched case-insensitively. For example
Junio C Hamanoa372d5b2021-02-26 01:34:3753this would also match the 'Commit Name <commit&#64;email.xx>' above:
Junio C Hamano7887f9b2021-01-25 23:32:3354--
Junio C Hamanoa372d5b2021-02-26 01:34:3755Proper Name <proper@email.xx> CoMmIt NaMe <CoMmIt@EmAiL.xX>
Junio C Hamano7887f9b2021-01-25 23:32:3356--
57
Junio C Hamano51a55bc2021-05-12 05:22:1958NOTES
59-----
60
61Git does not follow symbolic links when accessing a `.mailmap` file in
62the working tree. This keeps behavior consistent when the file is
63accessed from the index or a tree versus from the filesystem.
64
Junio C Hamano7887f9b2021-01-25 23:32:3365EXAMPLES
66--------
67
68Your history contains commits by two authors, Jane
69and Joe, whose names appear in the repository under several forms:
70
71------------
72Joe Developer <joe@example.com>
73Joe R. Developer <joe@example.com>
74Jane Doe <jane@example.com>
75Jane Doe <jane@laptop.(none)>
76Jane D. <jane@desktop.(none)>
77------------
78
79Now suppose that Joe wants his middle name initial used, and Jane
80prefers her family name fully spelled out. A `.mailmap` file to
81correct the names would look like:
82
83------------
84Joe R. Developer <joe@example.com>
85Jane Doe <jane@example.com>
86Jane Doe <jane@desktop.(none)>
87------------
88
Junio C Hamanoa372d5b2021-02-26 01:34:3789Note that there's no need to map the name for '<jane&#64;laptop.(none)>' to
Junio C Hamano7887f9b2021-01-25 23:32:3390only correct the names. However, leaving the obviously broken
Junio C Hamanoa372d5b2021-02-26 01:34:3791'<jane&#64;laptop.(none)>' and '<jane&#64;desktop.(none)>' E-Mails as-is is
Junio C Hamano7887f9b2021-01-25 23:32:3392usually not what you want. A `.mailmap` file which also corrects those
93is:
94
95------------
96Joe R. Developer <joe@example.com>
97Jane Doe <jane@example.com> <jane@laptop.(none)>
98Jane Doe <jane@example.com> <jane@desktop.(none)>
99------------
100
101Finally, let's say that Joe and Jane shared an E-Mail address, but not
102a name, e.g. by having these two commits in the history generated by a
103bug reporting system. I.e. names appearing in history as:
104
105------------
106Joe <bugs@example.com>
107Jane <bugs@example.com>
108------------
109
110A full `.mailmap` file which also handles those cases (an addition of
111two lines to the above example) would be:
112
113------------
114Joe R. Developer <joe@example.com>
115Jane Doe <jane@example.com> <jane@laptop.(none)>
116Jane Doe <jane@example.com> <jane@desktop.(none)>
117Joe R. Developer <joe@example.com> Joe <bugs@example.com>
118Jane Doe <jane@example.com> Jane <bugs@example.com>
119------------
120
121
122
123SEE ALSO
124--------
125linkgit:git-check-mailmap[1]
126
127
128GIT
129---
130Part of the linkgit:git[1] suite