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">
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">
10 p
, li
, dt
, dd
, div
, pre
, h1
, h2
, h3
, h4
, h5
, h6
{
12 border: 1px solid red;
17 margin: 1em 5% 1em 5%;
22 text-decoration: underline
;
42 h1
, h2
, h3
, h4
, h5
, h6
{
44 font-family: sans-serif
;
51 border-bottom: 2px solid silver
;
69 border: 1px solid silver
;
88 font-family: sans-serif
;
94 span#revnumber
, span#revdate
, span#revremark
{
95 font-family: sans-serif
;
99 font-family: sans-serif
;
101 border-top: 2px solid silver
;
107 padding-bottom: 0.5em;
111 padding-bottom: 0.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
{
122 margin-bottom: 1.5em;
124 div
.admonitionblock
{
126 margin-bottom: 2.5em;
129 div
.content
{ /* Block element content. */
133 /* Block element titles. */
134 div
.title
, caption
.title
{
136 font-family: sans-serif
;
140 margin-bottom: 0.5em;
146 td div
.title:first-child
{
149 div
.content div
.title:first-child
{
152 div
.content
+ div
.title
{
156 div
.sidebarblock
> div
.content
{
158 border: 1px solid silver
;
162 div
.listingblock
> div
.content
{
163 border: 1px solid silver
;
172 div
.quoteblock
> div
.attribution
{
181 div
.verseblock
> div
.content
{
184 div
.verseblock
> div
.attribution
{
188 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
189 div
.verseblock
+ div
.attribution
{
193 div
.admonitionblock
.icon
{
197 text-decoration: underline
;
199 padding-right: 0.5em;
201 div
.admonitionblock td
.content
{
203 border-left: 2px solid silver
;
206 div
.exampleblock
> div
.content
{
207 border-left: 2px solid silver
;
211 div
.imageblock div
.content
{ padding-left: 0; }
212 span
.image img
{ border-style: none
; }
213 a
.image:visited
{ color: white
; }
217 margin-bottom: 0.8em;
230 list-style-position: outside
;
233 list-style-type: decimal
;
236 list-style-type: lower-alpha
;
239 list-style-type: upper-alpha
;
242 list-style-type: lower-roman
;
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
{
252 margin-bottom: 0.1em;
255 div
.tableblock
> table
{
256 border: 3px solid
#527bbd;
259 font-family: sans-serif
;
271 /* Because the table frame attribute is overriden by CSS in most browsers. */
272 div
.tableblock
> table
[frame
="void"] {
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
;
287 margin-bottom: 0.8em;
290 padding-bottom: 15px;
292 dt
.hdlist1
.strong
, td
.hdlist1
.strong
{
298 padding-right: 0.8em;
304 div
.hdlist
.compact tr
{
314 div#footer-badges
{ display: none
; }
319 font-family: sans-serif
;
323 margin-bottom: 0.1em;
326 div
.toclevel1
, div
.toclevel2
, div
.toclevel3
, div
.toclevel4
{
342 /* Overrides for manpage documents */
345 padding-bottom: 0.5em;
346 border-top: 2px solid silver
;
347 border-bottom: 2px solid silver
;
357 div#toc
{ display: none
; }
360 /* Workarounds for IE6's broken and incomplete CSS2. */
362 div
.sidebar-content
{
364 border: 1px solid silver
;
367 div
.sidebar-title
, div
.image-title
{
369 font-family: sans-serif
;
372 margin-bottom: 0.5em;
375 div
.listingblock div
.content
{
376 border: 1px solid silver
;
381 div
.quoteblock-attribution
{
386 div
.verseblock-content
{
389 div
.verseblock-attribution
{
394 div
.exampleblock-content
{
395 border-left: 2px solid silver
;
399 /* IE6 sets dynamically generated links as visited. */
400 div#toc
a:visited
{ color: blue
; }
406 git-commit-tree(
1) Manual Page
409 <div class=
"sectionbody">
411 Create a new commit object
415 <h2 id=
"_synopsis">SYNOPSIS
</h2>
416 <div class=
"sectionbody">
417 <div class=
"verseblock">
418 <div class=
"verseblock-content"><em>git commit-tree
</em> <tree
> [(-p
<parent commit
>)
…]
< changelog
</div>
419 <div class=
"verseblock-attribution">
422 <h2 id=
"_description">DESCRIPTION
</h2>
423 <div class=
"sectionbody">
424 <div class=
"paragraph"><p>This is usually not what an end user wants to run directly. See
425 <a href=
"git-commit.html">git-commit(
1)
</a> instead.
</p></div>
426 <div class=
"paragraph"><p>Creates a new commit object based on the provided tree object and
427 emits the new commit object id on stdout.
</p></div>
428 <div class=
"paragraph"><p>A commit object may have any number of parents. With exactly one
429 parent, it is an ordinary commit. Having more than one parent makes
430 the commit a merge between several lines of history. Initial (root)
431 commits have no parents.
</p></div>
432 <div class=
"paragraph"><p>While a tree represents a particular directory state of a working
433 directory, a commit represents that state in
"time", and explains how
434 to get there.
</p></div>
435 <div class=
"paragraph"><p>Normally a commit would identify a new
"HEAD" state, and while git
436 doesn
’t care where you save the note about that state, in practice we
437 tend to just write the result to the file that is pointed at by
438 <tt>.git/HEAD
</tt>, so that we can always see what the last committed
441 <h2 id=
"_options">OPTIONS
</h2>
442 <div class=
"sectionbody">
443 <div class=
"dlist"><dl>
449 An existing tree object
453 -p
<parent commit
>
457 Each
<em>-p
</em> indicates the id of a parent commit object.
462 <h2 id=
"_commit_information">Commit Information
</h2>
463 <div class=
"sectionbody">
464 <div class=
"paragraph"><p>A commit encapsulates:
</p></div>
465 <div class=
"ulist"><ul>
468 all parent object ids
473 author name, email and date
478 committer name and email and the commit time.
482 <div class=
"paragraph"><p>While parent object ids are provided on the command line, author and
483 committer information is taken from the following environment variables,
485 <div class=
"literalblock">
486 <div class=
"content">
487 <pre><tt>GIT_AUTHOR_NAME
495 <div class=
"paragraph"><p>(nb
"<",
">" and
"\n"s are stripped)
</p></div>
496 <div class=
"paragraph"><p>In case (some of) these environment variables are not set, the information
497 is taken from the configuration items user.name and user.email, or, if not
498 present, system user name and fully qualified hostname.
</p></div>
499 <div class=
"paragraph"><p>A commit comment is read from stdin. If a changelog
500 entry is not provided via
"<" redirection,
<em>git commit-tree
</em> will just wait
501 for one to be entered and terminated with ^D.
</p></div>
503 <h2 id=
"_date_formats">DATE FORMATS
</h2>
504 <div class=
"sectionbody">
505 <div class=
"paragraph"><p>The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables
506 support the following date formats:
</p></div>
507 <div class=
"dlist"><dl>
513 It is
<tt><unix timestamp
> <timezone offset
></tt>, where
<tt><unix
514 timestamp
></tt> is the number of seconds since the UNIX epoch.
515 <tt><timezone offset
></tt> is a positive or negative offset from UTC.
516 For example CET (which is
2 hours ahead UTC) is
<tt>+
0200</tt>.
524 The standard email format as described by RFC
2822, for example
525 <tt>Thu,
07 Apr
2005 22:
13:
13 +
0200</tt>.
533 Time and date specified by the ISO
8601 standard, for example
534 <tt>2005-
04-
07T22:
13:
13</tt>. The parser accepts a space instead of the
535 <tt>T
</tt> character as well.
537 <div class=
"admonitionblock">
540 <div class=
"title">Note
</div>
542 <td class=
"content">In addition, the date part is accepted in the following formats:
543 <tt>YYYY.MM.DD
</tt>,
<tt>MM/DD/YYYY
</tt> and
<tt>DD.MM.YYYY
</tt>.
</td>
549 <h2 id=
"_diagnostics">Diagnostics
</h2>
550 <div class=
"sectionbody">
551 <div class=
"dlist"><dl>
553 You don
’t exist. Go away!
557 The passwd(
5) gecos field couldn
’t be read
561 Your parents must have hated you!
565 The passwd(
5) gecos field is longer than a giant static buffer.
569 Your sysadmin must hate you!
573 The passwd(
5) name field is longer than a giant static buffer.
578 <h2 id=
"_discussion">Discussion
</h2>
579 <div class=
"sectionbody">
580 <div class=
"paragraph"><p>At the core level, git is character encoding agnostic.
</p></div>
581 <div class=
"ulist"><ul>
584 The pathnames recorded in the index and in the tree objects
585 are treated as uninterpreted sequences of non-NUL bytes.
586 What readdir(
2) returns are what are recorded and compared
587 with the data git keeps track of, which in turn are expected
588 to be what lstat(
2) and creat(
2) accepts. There is no such
589 thing as pathname encoding translation.
594 The contents of the blob objects are uninterpreted sequences
595 of bytes. There is no encoding translation at the core
601 The commit log messages are uninterpreted sequences of non-NUL
606 <div class=
"paragraph"><p>Although we encourage that the commit log messages are encoded
607 in UTF-
8, both the core and git Porcelain are designed not to
608 force UTF-
8 on projects. If all participants of a particular
609 project find it more convenient to use legacy encodings, git
610 does not forbid it. However, there are a few things to keep in
612 <div class=
"olist arabic"><ol class=
"arabic">
615 <em>git commit
</em> and
<em>git commit-tree
</em> issues
616 a warning if the commit log message given to it does not look
617 like a valid UTF-
8 string, unless you explicitly say your
618 project uses a legacy encoding. The way to say this is to
619 have i18n.commitencoding in
<tt>.git/config
</tt> file, like this:
621 <div class=
"listingblock">
622 <div class=
"content">
624 commitencoding = ISO-
8859-
1</tt></pre>
626 <div class=
"paragraph"><p>Commit objects created with the above setting record the value
627 of
<tt>i18n.commitencoding
</tt> in its
<tt>encoding
</tt> header. This is to
628 help other people who look at them later. Lack of this header
629 implies that the commit log message is encoded in UTF-
8.
</p></div>
633 <em>git log
</em>,
<em>git show
</em>,
<em>git blame
</em> and friends look at the
634 <tt>encoding
</tt> header of a commit object, and try to re-code the
635 log message into UTF-
8 unless otherwise specified. You can
636 specify the desired output encoding with
637 <tt>i18n.logoutputencoding
</tt> in
<tt>.git/config
</tt> file, like this:
639 <div class=
"listingblock">
640 <div class=
"content">
642 logoutputencoding = ISO-
8859-
1</tt></pre>
644 <div class=
"paragraph"><p>If you do not have this configuration variable, the value of
645 <tt>i18n.commitencoding
</tt> is used instead.
</p></div>
648 <div class=
"paragraph"><p>Note that we deliberately chose not to re-code the commit log
649 message when a commit is made to force UTF-
8 at the commit
650 object level, because re-coding to UTF-
8 is not necessarily a
651 reversible operation.
</p></div>
653 <h2 id=
"_see_also">SEE ALSO
</h2>
654 <div class=
"sectionbody">
655 <div class=
"paragraph"><p><a href=
"git-write-tree.html">git-write-tree(
1)
</a></p></div>
657 <h2 id=
"_git">GIT
</h2>
658 <div class=
"sectionbody">
659 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
662 <div id=
"footer-text">
663 Last updated
2011-
07-
23 00:
49:
30 UTC