blob: 4fefc6423700996c960af7e77cb8ad7c63502fb2 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
Junio C Hamanoba4b9282008-07-06 05:20:316<meta name="generator" content="AsciiDoc 8.2.5" />
Junio C Hamano1a4e8412005-12-27 08:17:237<style type="text/css">
8/* Debug borders */
9p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
10/*
11 border: 1px solid red;
12*/
13}
14
15body {
16 margin: 1em 5% 1em 5%;
17}
18
Junio C Hamanoba4b9282008-07-06 05:20:3119a {
20 color: blue;
21 text-decoration: underline;
22}
23a:visited {
24 color: fuchsia;
25}
Junio C Hamano1a4e8412005-12-27 08:17:2326
27em {
28 font-style: italic;
29}
30
31strong {
32 font-weight: bold;
33}
34
35tt {
36 color: navy;
37}
38
39h1, h2, h3, h4, h5, h6 {
40 color: #527bbd;
41 font-family: sans-serif;
42 margin-top: 1.2em;
43 margin-bottom: 0.5em;
44 line-height: 1.3;
45}
46
Junio C Hamanoba4b9282008-07-06 05:20:3147h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2348 border-bottom: 2px solid silver;
49}
50h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2351 padding-top: 0.5em;
52}
Junio C Hamanoba4b9282008-07-06 05:20:3153h3 {
54 float: left;
55}
56h3 + * {
57 clear: left;
58}
Junio C Hamano1a4e8412005-12-27 08:17:2359
60div.sectionbody {
61 font-family: serif;
62 margin-left: 0;
63}
64
65hr {
66 border: 1px solid silver;
67}
68
69p {
70 margin-top: 0.5em;
71 margin-bottom: 0.5em;
72}
73
74pre {
75 padding: 0;
76 margin: 0;
77}
78
79span#author {
80 color: #527bbd;
81 font-family: sans-serif;
82 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:3183 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:2384}
85span#email {
86}
87span#revision {
88 font-family: sans-serif;
89}
90
91div#footer {
92 font-family: sans-serif;
93 font-size: small;
94 border-top: 2px solid silver;
95 padding-top: 0.5em;
96 margin-top: 4.0em;
97}
98div#footer-text {
99 float: left;
100 padding-bottom: 0.5em;
101}
102div#footer-badges {
103 float: right;
104 padding-bottom: 0.5em;
105}
106
107div#preamble,
108div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
109div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
110div.admonitionblock {
111 margin-right: 10%;
112 margin-top: 1.5em;
113 margin-bottom: 1.5em;
114}
115div.admonitionblock {
116 margin-top: 2.5em;
117 margin-bottom: 2.5em;
118}
119
120div.content { /* Block element content. */
121 padding: 0;
122}
123
124/* Block element titles. */
125div.title, caption.title {
126 font-family: sans-serif;
127 font-weight: bold;
128 text-align: left;
129 margin-top: 1.0em;
130 margin-bottom: 0.5em;
131}
132div.title + * {
133 margin-top: 0;
134}
135
136td div.title:first-child {
137 margin-top: 0.0em;
138}
139div.content div.title:first-child {
140 margin-top: 0.0em;
141}
142div.content + div.title {
143 margin-top: 0.0em;
144}
145
146div.sidebarblock > div.content {
147 background: #ffffee;
148 border: 1px solid silver;
149 padding: 0.5em;
150}
151
Junio C Hamanoba4b9282008-07-06 05:20:31152div.listingblock {
153 margin-right: 0%;
154}
Junio C Hamano1a4e8412005-12-27 08:17:23155div.listingblock > div.content {
156 border: 1px solid silver;
157 background: #f4f4f4;
158 padding: 0.5em;
159}
160
161div.quoteblock > div.content {
162 padding-left: 2.0em;
163}
Junio C Hamanoba4b9282008-07-06 05:20:31164
165div.attribution {
Junio C Hamano1a4e8412005-12-27 08:17:23166 text-align: right;
167}
Junio C Hamanoba4b9282008-07-06 05:20:31168div.verseblock + div.attribution {
169 text-align: left;
170}
Junio C Hamano1a4e8412005-12-27 08:17:23171
172div.admonitionblock .icon {
173 vertical-align: top;
174 font-size: 1.1em;
175 font-weight: bold;
176 text-decoration: underline;
177 color: #527bbd;
178 padding-right: 0.5em;
179}
180div.admonitionblock td.content {
181 padding-left: 0.5em;
182 border-left: 2px solid silver;
183}
184
185div.exampleblock > div.content {
186 border-left: 2px solid silver;
187 padding: 0.5em;
188}
189
190div.verseblock div.content {
191 white-space: pre;
192}
193
194div.imageblock div.content { padding-left: 0; }
195div.imageblock img { border: 1px solid silver; }
196span.image img { border-style: none; }
197
198dl {
199 margin-top: 0.8em;
200 margin-bottom: 0.8em;
201}
202dt {
203 margin-top: 0.5em;
204 margin-bottom: 0;
205 font-style: italic;
206}
207dd > *:first-child {
208 margin-top: 0;
209}
210
211ul, ol {
212 list-style-position: outside;
213}
Junio C Hamanoba4b9282008-07-06 05:20:31214div.olist2 ol {
Junio C Hamano1a4e8412005-12-27 08:17:23215 list-style-type: lower-alpha;
216}
217
218div.tableblock > table {
Junio C Hamanoba4b9282008-07-06 05:20:31219 border: 3px solid #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23220}
221thead {
222 font-family: sans-serif;
223 font-weight: bold;
224}
225tfoot {
226 font-weight: bold;
227}
228
229div.hlist {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
Junio C Hamanoba4b9282008-07-06 05:20:31233div.hlist td {
234 padding-bottom: 5px;
235}
Junio C Hamano1a4e8412005-12-27 08:17:23236td.hlist1 {
237 vertical-align: top;
238 font-style: italic;
239 padding-right: 0.8em;
240}
241td.hlist2 {
242 vertical-align: top;
243}
244
245@media print {
246 div#footer-badges { display: none; }
247}
Junio C Hamanoba4b9282008-07-06 05:20:31248
249div#toctitle {
250 color: #527bbd;
251 font-family: sans-serif;
252 font-size: 1.1em;
253 font-weight: bold;
254 margin-top: 1.0em;
255 margin-bottom: 0.1em;
256}
257
258div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
259 margin-top: 0;
260 margin-bottom: 0;
261}
262div.toclevel2 {
263 margin-left: 2em;
264 font-size: 0.9em;
265}
266div.toclevel3 {
267 margin-left: 4em;
268 font-size: 0.9em;
269}
270div.toclevel4 {
271 margin-left: 6em;
272 font-size: 0.9em;
273}
274include1::./stylesheets/xhtml11-manpage.css[]
Junio C Hamano1a4e8412005-12-27 08:17:23275/* Workarounds for IE6's broken and incomplete CSS2. */
276
277div.sidebar-content {
278 background: #ffffee;
279 border: 1px solid silver;
280 padding: 0.5em;
281}
282div.sidebar-title, div.image-title {
283 font-family: sans-serif;
284 font-weight: bold;
285 margin-top: 0.0em;
286 margin-bottom: 0.5em;
287}
288
289div.listingblock div.content {
290 border: 1px solid silver;
291 background: #f4f4f4;
292 padding: 0.5em;
293}
294
295div.quoteblock-content {
296 padding-left: 2.0em;
297}
298
299div.exampleblock-content {
300 border-left: 2px solid silver;
301 padding-left: 0.5em;
302}
Junio C Hamanoba4b9282008-07-06 05:20:31303
304/* IE6 sets dynamically generated links as visited. */
305div#toc a:visited { color: blue; }
Junio C Hamano1a4e8412005-12-27 08:17:23306</style>
307<title>git-am(1)</title>
308</head>
309<body>
310<div id="header">
311<h1>
312git-am(1) Manual Page
313</h1>
314<h2>NAME</h2>
315<div class="sectionbody">
316<p>git-am -
Junio C Hamano7c73c662007-01-19 00:37:50317 Apply a series of patches from a mailbox
Junio C Hamano1a4e8412005-12-27 08:17:23318</p>
319</div>
320</div>
321<h2>SYNOPSIS</h2>
322<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58323<div class="verseblock">
Junio C Hamanofce7c7e2008-07-02 03:06:38324<div class="content"><em>git am</em> [--signoff] [--keep] [--utf8 | --no-utf8]
Junio C Hamano9e96a1a2008-08-16 10:23:18325 [--3way] [--interactive]
Junio C Hamano0430e3a2007-05-15 03:13:17326 [--whitespace=&lt;option&gt;] [-C&lt;n&gt;] [-p&lt;n&gt;]
Junio C Hamano46a38aa2008-07-14 03:13:27327 [&lt;mbox&gt; | &lt;Maildir&gt;&#8230;]
Junio C Hamano5ba2c222008-07-21 04:33:46328<em>git am</em> (--skip | --resolved | --abort)</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23329</div>
Junio C Hamanoba4b9282008-07-06 05:20:31330<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23331<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31332<div class="para"><p>Splits mail messages in a mailbox into commit log message,
Junio C Hamano1a4e8412005-12-27 08:17:23333authorship information and patches, and applies them to the
Junio C Hamanoba4b9282008-07-06 05:20:31334current branch.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23335</div>
Junio C Hamanoba4b9282008-07-06 05:20:31336<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23337<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31338<div class="vlist"><dl>
Junio C Hamano1a4e8412005-12-27 08:17:23339<dt>
Junio C Hamanob7ed57a2007-05-25 05:01:30340&lt;mbox&gt;|&lt;Maildir&gt;&#8230;
Junio C Hamano9cb74f22007-02-12 04:15:05341</dt>
342<dd>
343<p>
344 The list of mailbox files to read patches from. If you do not
Junio C Hamanob7ed57a2007-05-25 05:01:30345 supply this argument, reads from the standard input. If you supply
346 directories, they'll be treated as Maildirs.
Junio C Hamano9cb74f22007-02-12 04:15:05347</p>
348</dd>
349<dt>
Junio C Hamanoeb415992008-06-08 22:49:47350-s
351</dt>
352<dt>
353--signoff
Junio C Hamano1a4e8412005-12-27 08:17:23354</dt>
355<dd>
356<p>
357 Add <tt>Signed-off-by:</tt> line to the commit message, using
358 the committer identity of yourself.
359</p>
360</dd>
361<dt>
Junio C Hamanoeb415992008-06-08 22:49:47362-k
363</dt>
364<dt>
365--keep
Junio C Hamano1a4e8412005-12-27 08:17:23366</dt>
367<dd>
368<p>
Junio C Hamanoba4b9282008-07-06 05:20:31369 Pass <tt>-k</tt> flag to <em>git-mailinfo</em> (see <a href="git-mailinfo.html">git-mailinfo(1)</a>).
Junio C Hamano1d3a6c72007-01-09 11:13:47370</p>
371</dd>
372<dt>
Junio C Hamanoeb415992008-06-08 22:49:47373-u
374</dt>
375<dt>
376--utf8
Junio C Hamano1d3a6c72007-01-09 11:13:47377</dt>
378<dd>
379<p>
Junio C Hamanoba4b9282008-07-06 05:20:31380 Pass <tt>-u</tt> flag to <em>git-mailinfo</em> (see <a href="git-mailinfo.html">git-mailinfo(1)</a>).
Junio C Hamano1d3a6c72007-01-09 11:13:47381 The proposed commit log message taken from the e-mail
Junio C Hamano0430e3a2007-05-15 03:13:17382 is re-coded into UTF-8 encoding (configuration variable
Junio C Hamano1d3a6c72007-01-09 11:13:47383 <tt>i18n.commitencoding</tt> can be used to specify project's
384 preferred encoding if it is not UTF-8).
385</p>
Junio C Hamanoba4b9282008-07-06 05:20:31386<div class="para"><p>This was optional in prior versions of git, but now it is the
387default. You could use <tt>--no-utf8</tt> to override this.</p></div>
Junio C Hamano1d3a6c72007-01-09 11:13:47388</dd>
389<dt>
390--no-utf8
391</dt>
392<dd>
393<p>
Junio C Hamanoba4b9282008-07-06 05:20:31394 Pass <tt>-n</tt> flag to <em>git-mailinfo</em> (see
Junio C Hamano1a4e8412005-12-27 08:17:23395 <a href="git-mailinfo.html">git-mailinfo(1)</a>).
396</p>
397</dd>
398<dt>
Junio C Hamanoeb415992008-06-08 22:49:47399-3
400</dt>
401<dt>
402--3way
Junio C Hamano0430e3a2007-05-15 03:13:17403</dt>
404<dd>
405<p>
406 When the patch does not apply cleanly, fall back on
407 3-way merge, if the patch records the identity of blobs
408 it is supposed to apply to, and we have those blobs
409 available locally.
410</p>
411</dd>
412<dt>
Junio C Hamano0430e3a2007-05-15 03:13:17413--whitespace=&lt;option&gt;
Junio C Hamano1a4e8412005-12-27 08:17:23414</dt>
415<dd>
416<p>
Junio C Hamanoba4b9282008-07-06 05:20:31417 This flag is passed to the <em>git-apply</em> (see <a href="git-apply.html">git-apply(1)</a>)
Junio C Hamano0430e3a2007-05-15 03:13:17418 program that applies
419 the patch.
420</p>
421</dd>
422<dt>
Junio C Hamanoeb415992008-06-08 22:49:47423-C&lt;n&gt;
424</dt>
425<dt>
426-p&lt;n&gt;
Junio C Hamano0430e3a2007-05-15 03:13:17427</dt>
428<dd>
429<p>
Junio C Hamanoba4b9282008-07-06 05:20:31430 These flags are passed to the <em>git-apply</em> (see <a href="git-apply.html">git-apply(1)</a>)
Junio C Hamano0430e3a2007-05-15 03:13:17431 program that applies
432 the patch.
433</p>
434</dd>
435<dt>
Junio C Hamanoeb415992008-06-08 22:49:47436-i
437</dt>
438<dt>
439--interactive
Junio C Hamano0430e3a2007-05-15 03:13:17440</dt>
441<dd>
442<p>
443 Run interactively.
Junio C Hamano1a4e8412005-12-27 08:17:23444</p>
445</dd>
446<dt>
447--skip
448</dt>
449<dd>
450<p>
451 Skip the current patch. This is only meaningful when
452 restarting an aborted patch.
453</p>
454</dd>
455<dt>
Junio C Hamanoeb415992008-06-08 22:49:47456-r
457</dt>
458<dt>
459--resolved
Junio C Hamano1a4e8412005-12-27 08:17:23460</dt>
461<dd>
462<p>
463 After a patch failure (e.g. attempting to apply
464 conflicting patch), the user has applied it by hand and
465 the index file stores the result of the application.
466 Make a commit using the authorship and commit log
467 extracted from the e-mail message and the current index
468 file, and continue.
469</p>
470</dd>
Junio C Hamano0e3cb532007-04-17 08:28:11471<dt>
472--resolvemsg=&lt;msg&gt;
473</dt>
474<dd>
475<p>
476 When a patch failure occurs, &lt;msg&gt; will be printed
477 to the screen before exiting. This overrides the
478 standard message informing you to use <tt>--resolved</tt>
479 or <tt>--skip</tt> to handle the failure. This is solely
Junio C Hamanoba4b9282008-07-06 05:20:31480 for internal use between <em>git-rebase</em> and <em>git-am</em>.
Junio C Hamano0e3cb532007-04-17 08:28:11481</p>
482</dd>
Junio C Hamano5ba2c222008-07-21 04:33:46483<dt>
484--abort
485</dt>
486<dd>
487<p>
488 Restore the original branch and abort the patching operation.
489</p>
490</dd>
Junio C Hamanoba4b9282008-07-06 05:20:31491</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:23492</div>
Junio C Hamanoba4b9282008-07-06 05:20:31493<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23494<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31495<div class="para"><p>The commit author name is taken from the "From: " line of the
Junio C Hamano35e57552007-03-25 07:54:35496message, and commit author time is taken from the "Date: " line
497of the message. The "Subject: " line is used as the title of
498the commit, after stripping common prefix "[PATCH &lt;anything&gt;]".
499It is supposed to describe what the commit is about concisely as
Junio C Hamanoba4b9282008-07-06 05:20:31500a one line text.</p></div>
501<div class="para"><p>The body of the message (iow, after a blank line that terminates
Junio C Hamano35e57552007-03-25 07:54:35502RFC2822 headers) can begin with "Subject: " and "From: " lines
503that are different from those of the mail header, to override
Junio C Hamanoba4b9282008-07-06 05:20:31504the values of these fields.</p></div>
505<div class="para"><p>The commit message is formed by the title taken from the
Junio C Hamano35e57552007-03-25 07:54:35506"Subject: ", a blank line and the body of the message up to
507where the patch begins. Excess whitespaces at the end of the
Junio C Hamanoba4b9282008-07-06 05:20:31508lines are automatically stripped.</p></div>
509<div class="para"><p>The patch is expected to be inline, directly following the
510message. Any line that is of form:</p></div>
511<div class="ilist"><ul>
Junio C Hamano35e57552007-03-25 07:54:35512<li>
513<p>
514three-dashes and end-of-line, or
515</p>
516</li>
517<li>
518<p>
519a line that begins with "diff -", or
520</p>
521</li>
522<li>
523<p>
524a line that begins with "Index: "
525</p>
526</li>
Junio C Hamanoba4b9282008-07-06 05:20:31527</ul></div>
528<div class="para"><p>is taken as the beginning of a patch, and the commit log message
529is terminated before the first occurrence of such a line.</p></div>
530<div class="para"><p>When initially invoking it, you give it names of the mailboxes
Junio C Hamano1a4e8412005-12-27 08:17:23531to crunch. Upon seeing the first patch that does not apply, it
Junio C Hamanoba4b9282008-07-06 05:20:31532aborts in the middle,. You can recover from this in one of two ways:</p></div>
533<div class="olist"><ol>
Junio C Hamano1a4e8412005-12-27 08:17:23534<li>
535<p>
Junio C Hamano0430e3a2007-05-15 03:13:17536skip the current patch by re-running the command with <em>--skip</em>
Junio C Hamano1a4e8412005-12-27 08:17:23537 option.
538</p>
539</li>
540<li>
541<p>
542hand resolve the conflict in the working directory, and update
543 the index file to bring it in a state that the patch should
544 have produced. Then run the command with <em>--resolved</em> option.
545</p>
546</li>
Junio C Hamanoba4b9282008-07-06 05:20:31547</ol></div>
Junio C Hamano0868a302008-07-22 09:20:44548<div class="para"><p>The command refuses to process new mailboxes while <tt>.git/rebase-apply</tt>
Junio C Hamano1a4e8412005-12-27 08:17:23549directory exists, so if you decide to start over from scratch,
Junio C Hamano0868a302008-07-22 09:20:44550run <tt>rm -f -r .git/rebase-apply</tt> before running the command with mailbox
Junio C Hamanoba4b9282008-07-06 05:20:31551names.</p></div>
Junio C Hamano38ddcce2008-07-15 15:49:03552<div class="para"><p>Before any patches are applied, ORIG_HEAD is set to the tip of the
553current branch. This is useful if you have problems with multiple
554commits, like running <em>git am</em> on the wrong branch or an error in the
555commits that is more easily fixed by changing the mailbox (e.g.
556errors in the "From:" lines).</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23557</div>
Junio C Hamanoba4b9282008-07-06 05:20:31558<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23559<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31560<div class="para"><p><a href="git-apply.html">git-apply(1)</a>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23561</div>
Junio C Hamanoba4b9282008-07-06 05:20:31562<h2 id="_author">Author</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23563<div class="sectionbody">
Junio C Hamano0868a302008-07-22 09:20:44564<div class="para"><p>Written by Junio C Hamano &lt;gitster@pobox.com&gt;</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23565</div>
Junio C Hamanoba4b9282008-07-06 05:20:31566<h2 id="_documentation">Documentation</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23567<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31568<div class="para"><p>Documentation by Petr Baudis, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23569</div>
Junio C Hamanoba4b9282008-07-06 05:20:31570<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23571<div class="sectionbody">
Junio C Hamanoba4b9282008-07-06 05:20:31572<div class="para"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23573</div>
574<div id="footer">
575<div id="footer-text">
Junio C Hamano4604fe52008-09-19 06:37:10576Last updated 2008-09-19 06:32:41 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23577</div>
578</div>
579</body>
580</html>