blob: 2345daac1b391e1be95f443b6a7151da7a097cc8 [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 Hamano7ccb9fd2006-07-15 01:38:406<meta name="generator" content="AsciiDoc 7.0.2" />
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
19a { color: blue; }
20a:visited { color: fuchsia; }
21
22em {
23 font-style: italic;
24}
25
26strong {
27 font-weight: bold;
28}
29
30tt {
31 color: navy;
32}
33
34h1, h2, h3, h4, h5, h6 {
35 color: #527bbd;
36 font-family: sans-serif;
37 margin-top: 1.2em;
38 margin-bottom: 0.5em;
39 line-height: 1.3;
40}
41
42h1 {
43 border-bottom: 2px solid silver;
44}
45h2 {
46 border-bottom: 2px solid silver;
47 padding-top: 0.5em;
48}
49
50div.sectionbody {
51 font-family: serif;
52 margin-left: 0;
53}
54
55hr {
56 border: 1px solid silver;
57}
58
59p {
60 margin-top: 0.5em;
61 margin-bottom: 0.5em;
62}
63
64pre {
65 padding: 0;
66 margin: 0;
67}
68
69span#author {
70 color: #527bbd;
71 font-family: sans-serif;
72 font-weight: bold;
73 font-size: 1.2em;
74}
75span#email {
76}
77span#revision {
78 font-family: sans-serif;
79}
80
81div#footer {
82 font-family: sans-serif;
83 font-size: small;
84 border-top: 2px solid silver;
85 padding-top: 0.5em;
86 margin-top: 4.0em;
87}
88div#footer-text {
89 float: left;
90 padding-bottom: 0.5em;
91}
92div#footer-badges {
93 float: right;
94 padding-bottom: 0.5em;
95}
96
97div#preamble,
98div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
99div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
100div.admonitionblock {
101 margin-right: 10%;
102 margin-top: 1.5em;
103 margin-bottom: 1.5em;
104}
105div.admonitionblock {
106 margin-top: 2.5em;
107 margin-bottom: 2.5em;
108}
109
110div.content { /* Block element content. */
111 padding: 0;
112}
113
114/* Block element titles. */
115div.title, caption.title {
116 font-family: sans-serif;
117 font-weight: bold;
118 text-align: left;
119 margin-top: 1.0em;
120 margin-bottom: 0.5em;
121}
122div.title + * {
123 margin-top: 0;
124}
125
126td div.title:first-child {
127 margin-top: 0.0em;
128}
129div.content div.title:first-child {
130 margin-top: 0.0em;
131}
132div.content + div.title {
133 margin-top: 0.0em;
134}
135
136div.sidebarblock > div.content {
137 background: #ffffee;
138 border: 1px solid silver;
139 padding: 0.5em;
140}
141
142div.listingblock > div.content {
143 border: 1px solid silver;
144 background: #f4f4f4;
145 padding: 0.5em;
146}
147
148div.quoteblock > div.content {
149 padding-left: 2.0em;
150}
151div.quoteblock .attribution {
152 text-align: right;
153}
154
155div.admonitionblock .icon {
156 vertical-align: top;
157 font-size: 1.1em;
158 font-weight: bold;
159 text-decoration: underline;
160 color: #527bbd;
161 padding-right: 0.5em;
162}
163div.admonitionblock td.content {
164 padding-left: 0.5em;
165 border-left: 2px solid silver;
166}
167
168div.exampleblock > div.content {
169 border-left: 2px solid silver;
170 padding: 0.5em;
171}
172
173div.verseblock div.content {
174 white-space: pre;
175}
176
177div.imageblock div.content { padding-left: 0; }
178div.imageblock img { border: 1px solid silver; }
179span.image img { border-style: none; }
180
181dl {
182 margin-top: 0.8em;
183 margin-bottom: 0.8em;
184}
185dt {
186 margin-top: 0.5em;
187 margin-bottom: 0;
188 font-style: italic;
189}
190dd > *:first-child {
191 margin-top: 0;
192}
193
194ul, ol {
195 list-style-position: outside;
196}
197ol.olist2 {
198 list-style-type: lower-alpha;
199}
200
201div.tableblock > table {
202 border-color: #527bbd;
203 border-width: 3px;
204}
205thead {
206 font-family: sans-serif;
207 font-weight: bold;
208}
209tfoot {
210 font-weight: bold;
211}
212
213div.hlist {
214 margin-top: 0.8em;
215 margin-bottom: 0.8em;
216}
217td.hlist1 {
218 vertical-align: top;
219 font-style: italic;
220 padding-right: 0.8em;
221}
222td.hlist2 {
223 vertical-align: top;
224}
225
226@media print {
227 div#footer-badges { display: none; }
228}
229include::./stylesheets/xhtml11-manpage.css[]
230/* Workarounds for IE6's broken and incomplete CSS2. */
231
232div.sidebar-content {
233 background: #ffffee;
234 border: 1px solid silver;
235 padding: 0.5em;
236}
237div.sidebar-title, div.image-title {
238 font-family: sans-serif;
239 font-weight: bold;
240 margin-top: 0.0em;
241 margin-bottom: 0.5em;
242}
243
244div.listingblock div.content {
245 border: 1px solid silver;
246 background: #f4f4f4;
247 padding: 0.5em;
248}
249
250div.quoteblock-content {
251 padding-left: 2.0em;
252}
253
254div.exampleblock-content {
255 border-left: 2px solid silver;
256 padding-left: 0.5em;
257}
258</style>
259<title>git-commit-tree(1)</title>
260</head>
261<body>
262<div id="header">
263<h1>
264git-commit-tree(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-commit-tree -
Junio C Hamano7c73c662007-01-19 00:37:50269 Create a new commit object
Junio C Hamano1a4e8412005-12-27 08:17:23270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
275<p><em>git-commit-tree</em> &lt;tree&gt; [-p &lt;parent commit&gt;]* &lt; changelog</p>
276</div>
277<h2>DESCRIPTION</h2>
278<div class="sectionbody">
Junio C Hamanoe58607f2007-01-17 23:27:45279<p>This is usually not what an end user wants to run directly. See
280<a href="git-commit.html">git-commit(1)</a> instead.</p>
Junio C Hamano1a4e8412005-12-27 08:17:23281<p>Creates a new commit object based on the provided tree object and
282emits the new commit object id on stdout. If no parent is given then
283it is considered to be an initial tree.</p>
284<p>A commit object usually has 1 parent (a commit after a change) or up
285to 16 parents. More than one parent represents a merge of branches
286that led to them.</p>
287<p>While a tree represents a particular directory state of a working
288directory, a commit represents that state in "time", and explains how
289to get there.</p>
290<p>Normally a commit would identify a new "HEAD" state, and while git
291doesn't care where you save the note about that state, in practice we
292tend to just write the result to the file that is pointed at by
293<tt>.git/HEAD</tt>, so that we can always see what the last committed
294state was.</p>
295</div>
296<h2>OPTIONS</h2>
297<div class="sectionbody">
298<dl>
299<dt>
300&lt;tree&gt;
301</dt>
302<dd>
303<p>
304 An existing tree object
305</p>
306</dd>
307<dt>
308-p &lt;parent commit&gt;
309</dt>
310<dd>
311<p>
312 Each <em>-p</em> indicates the id of a parent commit object.
313</p>
314</dd>
315</dl>
316</div>
317<h2>Commit Information</h2>
318<div class="sectionbody">
319<p>A commit encapsulates:</p>
320<ul>
321<li>
322<p>
323all parent object ids
324</p>
325</li>
326<li>
327<p>
328author name, email and date
329</p>
330</li>
331<li>
332<p>
333committer name and email and the commit time.
334</p>
335</li>
336</ul>
Junio C Hamano1b11dcb2007-08-18 07:20:55337<p>While parent object ids are provided on the command line, author and
Junio C Hamanoa6387422007-08-25 03:54:27338committer information is taken from the following environment variables,
Junio C Hamano1b11dcb2007-08-18 07:20:55339if set:</p>
Junio C Hamano1a4e8412005-12-27 08:17:23340<div class="literalblock">
341<div class="content">
342<pre><tt>GIT_AUTHOR_NAME
343GIT_AUTHOR_EMAIL
344GIT_AUTHOR_DATE
345GIT_COMMITTER_NAME
Junio C Hamano469d60e2007-04-29 18:30:34346GIT_COMMITTER_EMAIL
347GIT_COMMITTER_DATE
348EMAIL</tt></pre>
Junio C Hamano1a4e8412005-12-27 08:17:23349</div></div>
350<p>(nb "&lt;", "&gt;" and "\n"s are stripped)</p>
Junio C Hamano1b11dcb2007-08-18 07:20:55351<p>In case (some of) these environment variables are not set, the information
352is taken from the configuration items user.name and user.email, or, if not
353present, system user name and fully qualified hostname.</p>
Junio C Hamanoc0ea7c62007-07-15 07:19:06354<p>A commit comment is read from stdin. If a changelog
Junio C Hamano1a4e8412005-12-27 08:17:23355entry is not provided via "&lt;" redirection, "git-commit-tree" will just wait
356for one to be entered and terminated with ^D.</p>
357</div>
358<h2>Diagnostics</h2>
359<div class="sectionbody">
360<dl>
361<dt>
362You don't exist. Go away!
363</dt>
364<dd>
365<p>
366 The passwd(5) gecos field couldn't be read
367</p>
368</dd>
369<dt>
370Your parents must have hated you!
371</dt>
372<dd>
373<p>
374 The password(5) gecos field is longer than a giant static buffer.
375</p>
376</dd>
377<dt>
378Your sysadmin must hate you!
379</dt>
380<dd>
381<p>
382 The password(5) name field is longer than a giant static buffer.
383</p>
384</dd>
385</dl>
386</div>
Junio C Hamano775a0f42006-12-31 01:19:14387<h2>Discussion</h2>
388<div class="sectionbody">
389<p>At the core level, git is character encoding agnostic.</p>
390<ul>
391<li>
392<p>
393The pathnames recorded in the index and in the tree objects
394 are treated as uninterpreted sequences of non-NUL bytes.
395 What readdir(2) returns are what are recorded and compared
396 with the data git keeps track of, which in turn are expected
397 to be what lstat(2) and creat(2) accepts. There is no such
398 thing as pathname encoding translation.
399</p>
400</li>
401<li>
402<p>
403The contents of the blob objects are uninterpreted sequence
404 of bytes. There is no encoding translation at the core
405 level.
406</p>
407</li>
408<li>
409<p>
410The commit log messages are uninterpreted sequence of non-NUL
411 bytes.
412</p>
413</li>
414</ul>
415<p>Although we encourage that the commit log messages are encoded
416in UTF-8, both the core and git Porcelain are designed not to
417force UTF-8 on projects. If all participants of a particular
418project find it more convenient to use legacy encodings, git
419does not forbid it. However, there are a few things to keep in
420mind.</p>
421<ol>
422<li>
423<p>
424<tt>git-commit-tree</tt> (hence, <tt>git-commit</tt> which uses it) issues
Junio C Hamano14b76482008-01-05 10:32:26425 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:14426 like a valid UTF-8 string, unless you explicitly say your
427 project uses a legacy encoding. The way to say this is to
Junio C Hamano35bb3f62007-02-19 05:35:53428 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:14429</p>
430<div class="listingblock">
431<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:53432<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:14433 commitencoding = ISO-8859-1</tt></pre>
434</div></div>
435<p>Commit objects created with the above setting record the value
Junio C Hamano35bb3f62007-02-19 05:35:53436of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:14437help other people who look at them later. Lack of this header
438implies that the commit log message is encoded in UTF-8.</p>
439</li>
440<li>
441<p>
442<tt>git-log</tt>, <tt>git-show</tt> and friends looks at the <tt>encoding</tt>
443 header of a commit object, and tries to re-code the log
444 message into UTF-8 unless otherwise specified. You can
445 specify the desired output encoding with
Junio C Hamano35bb3f62007-02-19 05:35:53446 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:14447</p>
448<div class="listingblock">
449<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:53450<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:14451 logoutputencoding = ISO-8859-1</tt></pre>
452</div></div>
453<p>If you do not have this configuration variable, the value of
Junio C Hamano35bb3f62007-02-19 05:35:53454<tt>i18n.commitencoding</tt> is used instead.</p>
Junio C Hamano775a0f42006-12-31 01:19:14455</li>
456</ol>
457<p>Note that we deliberately chose not to re-code the commit log
458message when a commit is made to force UTF-8 at the commit
459object level, because re-coding to UTF-8 is not necessarily a
460reversible operation.</p>
461</div>
Junio C Hamano9049d912008-05-29 02:09:50462<h2>SEE ALSO</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23463<div class="sectionbody">
464<p><a href="git-write-tree.html">git-write-tree(1)</a></p>
465</div>
466<h2>Author</h2>
467<div class="sectionbody">
468<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt;</p>
469</div>
470<h2>Documentation</h2>
471<div class="sectionbody">
472<p>Documentation by David Greaves, Junio C Hamano and the git-list &lt;git@vger.kernel.org&gt;.</p>
473</div>
474<h2>GIT</h2>
475<div class="sectionbody">
Junio C Hamanof7c042d2008-06-06 22:50:53476<p>Part of the <a href="git.html">git(1)</a> suite</p>
Junio C Hamano1a4e8412005-12-27 08:17:23477</div>
478<div id="footer">
479<div id="footer-text">
Junio C Hamanoe2b205c2008-06-08 01:43:44480Last updated 08-Jun-2008 01:33:27 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23481</div>
482</div>
483</body>
484</html>