Autogenerated HTML docs for v1.7.5-52-ge839f
[git/jnareb-git.git] / git-commit-tree.html
blobb42ad330b0757521b80a7d0c671f40ef44f801f8
1 <!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" />
6 <meta name="generator" content="AsciiDoc 8.4.5" />
7 <title>git-commit-tree(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.5em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.5em;
126 margin-bottom: 2.5em;
129 div.content { /* Block element content. */
130 padding: 0;
133 /* Block element titles. */
134 div.title, caption.title {
135 color: #527bbd;
136 font-family: sans-serif;
137 font-weight: bold;
138 text-align: left;
139 margin-top: 1.0em;
140 margin-bottom: 0.5em;
142 div.title + * {
143 margin-top: 0;
146 td div.title:first-child {
147 margin-top: 0.0em;
149 div.content div.title:first-child {
150 margin-top: 0.0em;
152 div.content + div.title {
153 margin-top: 0.0em;
156 div.sidebarblock > div.content {
157 background: #ffffee;
158 border: 1px solid silver;
159 padding: 0.5em;
162 div.listingblock > div.content {
163 border: 1px solid silver;
164 background: #f4f4f4;
165 padding: 0.5em;
168 div.quoteblock {
169 padding-left: 2.0em;
170 margin-right: 10%;
172 div.quoteblock > div.attribution {
173 padding-top: 0.5em;
174 text-align: right;
177 div.verseblock {
178 padding-left: 2.0em;
179 margin-right: 10%;
181 div.verseblock > div.content {
182 white-space: pre;
184 div.verseblock > div.attribution {
185 padding-top: 0.75em;
186 text-align: left;
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div.verseblock + div.attribution {
190 text-align: left;
193 div.admonitionblock .icon {
194 vertical-align: top;
195 font-size: 1.1em;
196 font-weight: bold;
197 text-decoration: underline;
198 color: #527bbd;
199 padding-right: 0.5em;
201 div.admonitionblock td.content {
202 padding-left: 0.5em;
203 border-left: 2px solid silver;
206 div.exampleblock > div.content {
207 border-left: 2px solid silver;
208 padding: 0.5em;
211 div.imageblock div.content { padding-left: 0; }
212 span.image img { border-style: none; }
213 a.image:visited { color: white; }
215 dl {
216 margin-top: 0.8em;
217 margin-bottom: 0.8em;
219 dt {
220 margin-top: 0.5em;
221 margin-bottom: 0;
222 font-style: normal;
223 color: navy;
225 dd > *:first-child {
226 margin-top: 0.1em;
229 ul, ol {
230 list-style-position: outside;
232 ol.arabic {
233 list-style-type: decimal;
235 ol.loweralpha {
236 list-style-type: lower-alpha;
238 ol.upperalpha {
239 list-style-type: upper-alpha;
241 ol.lowerroman {
242 list-style-type: lower-roman;
244 ol.upperroman {
245 list-style-type: upper-roman;
248 div.compact ul, div.compact ol,
249 div.compact p, div.compact p,
250 div.compact div, div.compact div {
251 margin-top: 0.1em;
252 margin-bottom: 0.1em;
255 div.tableblock > table {
256 border: 3px solid #527bbd;
258 thead {
259 font-family: sans-serif;
260 font-weight: bold;
262 tfoot {
263 font-weight: bold;
265 td > div.verse {
266 white-space: pre;
268 p.table {
269 margin-top: 0;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div.tableblock > table[frame="void"] {
273 border-style: none;
275 div.tableblock > table[frame="hsides"] {
276 border-left-style: none;
277 border-right-style: none;
279 div.tableblock > table[frame="vsides"] {
280 border-top-style: none;
281 border-bottom-style: none;
285 div.hdlist {
286 margin-top: 0.8em;
287 margin-bottom: 0.8em;
289 div.hdlist tr {
290 padding-bottom: 15px;
292 dt.hdlist1.strong, td.hdlist1.strong {
293 font-weight: bold;
295 td.hdlist1 {
296 vertical-align: top;
297 font-style: normal;
298 padding-right: 0.8em;
299 color: navy;
301 td.hdlist2 {
302 vertical-align: top;
304 div.hdlist.compact tr {
305 margin: 0;
306 padding-bottom: 0;
309 .comment {
310 background: yellow;
313 @media print {
314 div#footer-badges { display: none; }
317 div#toctitle {
318 color: #527bbd;
319 font-family: sans-serif;
320 font-size: 1.1em;
321 font-weight: bold;
322 margin-top: 1.0em;
323 margin-bottom: 0.1em;
326 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
327 margin-top: 0;
328 margin-bottom: 0;
330 div.toclevel2 {
331 margin-left: 2em;
332 font-size: 0.9em;
334 div.toclevel3 {
335 margin-left: 4em;
336 font-size: 0.9em;
338 div.toclevel4 {
339 margin-left: 6em;
340 font-size: 0.9em;
342 /* Overrides for manpage documents */
343 h1 {
344 padding-top: 0.5em;
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver;
347 border-bottom: 2px solid silver;
349 h2 {
350 border-style: none;
352 div.sectionbody {
353 margin-left: 5%;
356 @media print {
357 div#toc { display: none; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div.sidebar-content {
363 background: #ffffee;
364 border: 1px solid silver;
365 padding: 0.5em;
367 div.sidebar-title, div.image-title {
368 color: #527bbd;
369 font-family: sans-serif;
370 font-weight: bold;
371 margin-top: 0.0em;
372 margin-bottom: 0.5em;
375 div.listingblock div.content {
376 border: 1px solid silver;
377 background: #f4f4f4;
378 padding: 0.5em;
381 div.quoteblock-attribution {
382 padding-top: 0.5em;
383 text-align: right;
386 div.verseblock-content {
387 white-space: pre;
389 div.verseblock-attribution {
390 padding-top: 0.75em;
391 text-align: left;
394 div.exampleblock-content {
395 border-left: 2px solid silver;
396 padding-left: 0.5em;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc a:visited { color: blue; }
401 </style>
402 </head>
403 <body>
404 <div id="header">
405 <h1>
406 git-commit-tree(1) Manual Page
407 </h1>
408 <h2>NAME</h2>
409 <div class="sectionbody">
410 <p>git-commit-tree -
411 Create a new commit object
412 </p>
413 </div>
414 </div>
415 <h2 id="_synopsis">SYNOPSIS</h2>
416 <div class="sectionbody">
417 <div class="paragraph"><p><em>git commit-tree</em> &lt;tree&gt; [(-p &lt;parent commit&gt;)&#8230;] &lt; changelog</p></div>
418 </div>
419 <h2 id="_description">DESCRIPTION</h2>
420 <div class="sectionbody">
421 <div class="paragraph"><p>This is usually not what an end user wants to run directly. See
422 <a href="git-commit.html">git-commit(1)</a> instead.</p></div>
423 <div class="paragraph"><p>Creates a new commit object based on the provided tree object and
424 emits the new commit object id on stdout.</p></div>
425 <div class="paragraph"><p>A commit object may have any number of parents. With exactly one
426 parent, it is an ordinary commit. Having more than one parent makes
427 the commit a merge between several lines of history. Initial (root)
428 commits have no parents.</p></div>
429 <div class="paragraph"><p>While a tree represents a particular directory state of a working
430 directory, a commit represents that state in "time", and explains how
431 to get there.</p></div>
432 <div class="paragraph"><p>Normally a commit would identify a new "HEAD" state, and while git
433 doesn&#8217;t care where you save the note about that state, in practice we
434 tend to just write the result to the file that is pointed at by
435 <tt>.git/HEAD</tt>, so that we can always see what the last committed
436 state was.</p></div>
437 </div>
438 <h2 id="_options">OPTIONS</h2>
439 <div class="sectionbody">
440 <div class="dlist"><dl>
441 <dt class="hdlist1">
442 &lt;tree&gt;
443 </dt>
444 <dd>
446 An existing tree object
447 </p>
448 </dd>
449 <dt class="hdlist1">
450 -p &lt;parent commit&gt;
451 </dt>
452 <dd>
454 Each <em>-p</em> indicates the id of a parent commit object.
455 </p>
456 </dd>
457 </dl></div>
458 </div>
459 <h2 id="_commit_information">Commit Information</h2>
460 <div class="sectionbody">
461 <div class="paragraph"><p>A commit encapsulates:</p></div>
462 <div class="ulist"><ul>
463 <li>
465 all parent object ids
466 </p>
467 </li>
468 <li>
470 author name, email and date
471 </p>
472 </li>
473 <li>
475 committer name and email and the commit time.
476 </p>
477 </li>
478 </ul></div>
479 <div class="paragraph"><p>While parent object ids are provided on the command line, author and
480 committer information is taken from the following environment variables,
481 if set:</p></div>
482 <div class="literalblock">
483 <div class="content">
484 <pre><tt>GIT_AUTHOR_NAME
485 GIT_AUTHOR_EMAIL
486 GIT_AUTHOR_DATE
487 GIT_COMMITTER_NAME
488 GIT_COMMITTER_EMAIL
489 GIT_COMMITTER_DATE
490 EMAIL</tt></pre>
491 </div></div>
492 <div class="paragraph"><p>(nb "&lt;", "&gt;" and "\n"s are stripped)</p></div>
493 <div class="paragraph"><p>In case (some of) these environment variables are not set, the information
494 is taken from the configuration items user.name and user.email, or, if not
495 present, system user name and fully qualified hostname.</p></div>
496 <div class="paragraph"><p>A commit comment is read from stdin. If a changelog
497 entry is not provided via "&lt;" redirection, <em>git commit-tree</em> will just wait
498 for one to be entered and terminated with ^D.</p></div>
499 </div>
500 <h2 id="_date_formats">DATE FORMATS</h2>
501 <div class="sectionbody">
502 <div class="paragraph"><p>The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables
503 support the following date formats:</p></div>
504 <div class="dlist"><dl>
505 <dt class="hdlist1">
506 Git internal format
507 </dt>
508 <dd>
510 It is <tt>&lt;unix timestamp&gt; &lt;timezone offset&gt;</tt>, where <tt>&lt;unix
511 timestamp&gt;</tt> is the number of seconds since the UNIX epoch.
512 <tt>&lt;timezone offset&gt;</tt> is a positive or negative offset from UTC.
513 For example CET (which is 2 hours ahead UTC) is <tt>+0200</tt>.
514 </p>
515 </dd>
516 <dt class="hdlist1">
517 RFC 2822
518 </dt>
519 <dd>
521 The standard email format as described by RFC 2822, for example
522 <tt>Thu, 07 Apr 2005 22:13:13 +0200</tt>.
523 </p>
524 </dd>
525 <dt class="hdlist1">
526 ISO 8601
527 </dt>
528 <dd>
530 Time and date specified by the ISO 8601 standard, for example
531 <tt>2005-04-07T22:13:13</tt>. The parser accepts a space instead of the
532 <tt>T</tt> character as well.
533 </p>
534 <div class="admonitionblock">
535 <table><tr>
536 <td class="icon">
537 <div class="title">Note</div>
538 </td>
539 <td class="content">In addition, the date part is accepted in the following formats:
540 <tt>YYYY.MM.DD</tt>, <tt>MM/DD/YYYY</tt> and <tt>DD.MM.YYYY</tt>.</td>
541 </tr></table>
542 </div>
543 </dd>
544 </dl></div>
545 </div>
546 <h2 id="_diagnostics">Diagnostics</h2>
547 <div class="sectionbody">
548 <div class="dlist"><dl>
549 <dt class="hdlist1">
550 You don&#8217;t exist. Go away!
551 </dt>
552 <dd>
554 The passwd(5) gecos field couldn&#8217;t be read
555 </p>
556 </dd>
557 <dt class="hdlist1">
558 Your parents must have hated you!
559 </dt>
560 <dd>
562 The passwd(5) gecos field is longer than a giant static buffer.
563 </p>
564 </dd>
565 <dt class="hdlist1">
566 Your sysadmin must hate you!
567 </dt>
568 <dd>
570 The passwd(5) name field is longer than a giant static buffer.
571 </p>
572 </dd>
573 </dl></div>
574 </div>
575 <h2 id="_discussion">Discussion</h2>
576 <div class="sectionbody">
577 <div class="paragraph"><p>At the core level, git is character encoding agnostic.</p></div>
578 <div class="ulist"><ul>
579 <li>
581 The pathnames recorded in the index and in the tree objects
582 are treated as uninterpreted sequences of non-NUL bytes.
583 What readdir(2) returns are what are recorded and compared
584 with the data git keeps track of, which in turn are expected
585 to be what lstat(2) and creat(2) accepts. There is no such
586 thing as pathname encoding translation.
587 </p>
588 </li>
589 <li>
591 The contents of the blob objects are uninterpreted sequences
592 of bytes. There is no encoding translation at the core
593 level.
594 </p>
595 </li>
596 <li>
598 The commit log messages are uninterpreted sequences of non-NUL
599 bytes.
600 </p>
601 </li>
602 </ul></div>
603 <div class="paragraph"><p>Although we encourage that the commit log messages are encoded
604 in UTF-8, both the core and git Porcelain are designed not to
605 force UTF-8 on projects. If all participants of a particular
606 project find it more convenient to use legacy encodings, git
607 does not forbid it. However, there are a few things to keep in
608 mind.</p></div>
609 <div class="olist arabic"><ol class="arabic">
610 <li>
612 <em>git commit</em> and <em>git commit-tree</em> issues
613 a warning if the commit log message given to it does not look
614 like a valid UTF-8 string, unless you explicitly say your
615 project uses a legacy encoding. The way to say this is to
616 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
617 </p>
618 <div class="listingblock">
619 <div class="content">
620 <pre><tt>[i18n]
621 commitencoding = ISO-8859-1</tt></pre>
622 </div></div>
623 <div class="paragraph"><p>Commit objects created with the above setting record the value
624 of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
625 help other people who look at them later. Lack of this header
626 implies that the commit log message is encoded in UTF-8.</p></div>
627 </li>
628 <li>
630 <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
631 <tt>encoding</tt> header of a commit object, and try to re-code the
632 log message into UTF-8 unless otherwise specified. You can
633 specify the desired output encoding with
634 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
635 </p>
636 <div class="listingblock">
637 <div class="content">
638 <pre><tt>[i18n]
639 logoutputencoding = ISO-8859-1</tt></pre>
640 </div></div>
641 <div class="paragraph"><p>If you do not have this configuration variable, the value of
642 <tt>i18n.commitencoding</tt> is used instead.</p></div>
643 </li>
644 </ol></div>
645 <div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
646 message when a commit is made to force UTF-8 at the commit
647 object level, because re-coding to UTF-8 is not necessarily a
648 reversible operation.</p></div>
649 </div>
650 <h2 id="_see_also">SEE ALSO</h2>
651 <div class="sectionbody">
652 <div class="paragraph"><p><a href="git-write-tree.html">git-write-tree(1)</a></p></div>
653 </div>
654 <h2 id="_git">GIT</h2>
655 <div class="sectionbody">
656 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
657 </div>
658 <div id="footer">
659 <div id="footer-text">
660 Last updated 2011-03-15 23:30:13 UTC
661 </div>
662 </div>
663 </body>
664 </html>