1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
<h1>gitmailmap</h1> <h2 id="_name">Name</h2> <div class="sectionbody"> <p>gitmailmap - Map author/committer names and/or E-Mail addresses</p> </div> <h2 id="_synopsis">Synopsis</h2> <div class="sectionbody"> <p>$GIT_WORK_TREE/.mailmap</p> </div> <h2 id="_description">Description</h2> <div class="sectionbody"> <p>If the file <code>.mailmap</code> exists at the toplevel of the repository, or at the location pointed to by the <code>mailmap.file</code> or <code>mailmap.blob</code> configuration options (see <a href="git-config">git-config[1]</a>), it is used to map author and committer names and email addresses to canonical real names and email addresses.</p> </div> <h2 id="_syntax">Syntax</h2> <div class="sectionbody"> <p>The <code>#</code> character begins a comment to the end of line, blank lines are ignored.</p> <p>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 <code><</code> and <code>></code>) to map to the name. For example:</p> <div class="openblock"> <div class="content"> <div class="literalblock"> <div class="content"> <pre>Proper Name <commit@email.xx></pre> </div> </div> </div> </div> <p>The more complex forms are:</p> <div class="openblock"> <div class="content"> <div class="literalblock"> <div class="content"> <pre><proper@email.xx> <commit@email.xx></pre> </div> </div> </div> </div> <p>which allows mailmap to replace only the email part of a commit, and:</p> <div class="openblock"> <div class="content"> <div class="literalblock"> <div class="content"> <pre>Proper Name <proper@email.xx> <commit@email.xx></pre> </div> </div> </div> </div> <p>which allows mailmap to replace both the name and the email of a commit matching the specified commit email address, and:</p> <div class="openblock"> <div class="content"> <div class="literalblock"> <div class="content"> <pre>Proper Name <proper@email.xx> Commit Name <commit@email.xx></pre> </div> </div> </div> </div> <p>which allows mailmap to replace both the name and the email of a commit matching both the specified commit name and email address.</p> <p>Both E-Mails and names are matched case-insensitively. For example this would also match the <code>Commit Name <commit@email.xx></code> above:</p> <div class="openblock"> <div class="content"> <div class="literalblock"> <div class="content"> <pre>Proper Name <proper@email.xx> CoMmIt NaMe <CoMmIt@EmAiL.xX></pre> </div> </div> </div> </div> </div> <h2 id="_notes">Notes</h2> <div class="sectionbody"> <p>Git does not follow symbolic links when accessing a <code>.mailmap</code> file in the working tree. This keeps behavior consistent when the file is accessed from the index or a tree versus from the filesystem.</p> </div> <h2 id="_examples">Examples</h2> <div class="sectionbody"> <p>Your history contains commits by two authors, Jane and Joe, whose names appear in the repository under several forms:</p> <div class="listingblock"> <div class="content"> <pre>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)></pre> </div> </div> <p>Now suppose that Joe wants his middle name initial used, and Jane prefers her family name fully spelled out. A <code>.mailmap</code> file to correct the names would look like:</p> <div class="listingblock"> <div class="content"> <pre>Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com>
Jane Doe <jane@desktop.(none)></pre> </div> </div> <p>Note that there’s no need to map the name for <code><jane@laptop.(none)></code> to only correct the names. However, leaving the obviously broken <code><jane@laptop.(none)></code> and <code><jane@desktop.(none)></code> E-Mails as-is is usually not what you want. A <code>.mailmap</code> file which also corrects those is:</p> <div class="listingblock"> <div class="content"> <pre>Joe R. Developer <joe@example.com>
Jane Doe <jane@example.com> <jane@laptop.(none)>
Jane Doe <jane@example.com> <jane@desktop.(none)></pre> </div> </div> <p>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:</p> <div class="listingblock"> <div class="content"> <pre>Joe <bugs@example.com>
Jane <bugs@example.com></pre> </div> </div> <p>A full <code>.mailmap</code> file which also handles those cases (an addition of two lines to the above example) would be:</p> <div class="listingblock"> <div class="content"> <pre>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></pre> </div> </div> </div> <h2 id="_see_also">See also</h2> <div class="sectionbody"> <p><a href="git-check-mailmap">git-check-mailmap[1]</a></p> </div><div class="_attribution">
<p class="_attribution-p">
© 2012–2024 Scott Chacon and others<br>Licensed under the MIT License.<br>
<a href="https://git-scm.com/docs/gitmailmap" class="_attribution-link">https://git-scm.com/docs/gitmailmap</a>
</p>
</div>
|