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