summaryrefslogtreecommitdiff
path: root/devdocs/git/gitmailmap.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/git/gitmailmap.html')
-rw-r--r--devdocs/git/gitmailmap.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/devdocs/git/gitmailmap.html b/devdocs/git/gitmailmap.html
new file mode 100644
index 00000000..79d9a9ef
--- /dev/null
+++ b/devdocs/git/gitmailmap.html
@@ -0,0 +1,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>&lt;</code> and <code>&gt;</code>) to map to the name. For example:</p> <div class="openblock"> <div class="content"> <div class="literalblock"> <div class="content"> <pre>Proper Name &lt;commit@email.xx&gt;</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>&lt;proper@email.xx&gt; &lt;commit@email.xx&gt;</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 &lt;proper@email.xx&gt; &lt;commit@email.xx&gt;</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 &lt;proper@email.xx&gt; Commit Name &lt;commit@email.xx&gt;</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 &lt;commit@email.xx&gt;</code> above:</p> <div class="openblock"> <div class="content"> <div class="literalblock"> <div class="content"> <pre>Proper Name &lt;proper@email.xx&gt; CoMmIt NaMe &lt;CoMmIt@EmAiL.xX&gt;</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 &lt;joe@example.com&gt;
+Joe R. Developer &lt;joe@example.com&gt;
+Jane Doe &lt;jane@example.com&gt;
+Jane Doe &lt;jane@laptop.(none)&gt;
+Jane D. &lt;jane@desktop.(none)&gt;</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 &lt;joe@example.com&gt;
+Jane Doe &lt;jane@example.com&gt;
+Jane Doe &lt;jane@desktop.(none)&gt;</pre> </div> </div> <p>Note that there’s no need to map the name for <code>&lt;jane@laptop.(none)&gt;</code> to only correct the names. However, leaving the obviously broken <code>&lt;jane@laptop.(none)&gt;</code> and <code>&lt;jane@desktop.(none)&gt;</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 &lt;joe@example.com&gt;
+Jane Doe &lt;jane@example.com&gt; &lt;jane@laptop.(none)&gt;
+Jane Doe &lt;jane@example.com&gt; &lt;jane@desktop.(none)&gt;</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 &lt;bugs@example.com&gt;
+Jane &lt;bugs@example.com&gt;</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 &lt;joe@example.com&gt;
+Jane Doe &lt;jane@example.com&gt; &lt;jane@laptop.(none)&gt;
+Jane Doe &lt;jane@example.com&gt; &lt;jane@desktop.(none)&gt;
+Joe R. Developer &lt;joe@example.com&gt; Joe &lt;bugs@example.com&gt;
+Jane Doe &lt;jane@example.com&gt; Jane &lt;bugs@example.com&gt;</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">
+ &copy; 2012&ndash;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>