blob: 5e7e4aaf0849b0e2cfe4d5bcff9dbf7e3ed6afa6 [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 Hamano40f2f8d2006-02-07 08:04:396<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(1)</title>
260</head>
261<body>
262<div id="header">
263<h1>
264git-commit(1) Manual Page
265</h1>
266<h2>NAME</h2>
267<div class="sectionbody">
268<p>git-commit -
Junio C Hamano7c73c662007-01-19 00:37:50269 Record changes to the repository
Junio C Hamano1a4e8412005-12-27 08:17:23270</p>
271</div>
272</div>
273<h2>SYNOPSIS</h2>
274<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58275<div class="verseblock">
Junio C Hamano1e6e0062007-07-13 05:33:25276<div class="content"><em>git-commit</em> [-a | --interactive] [-s] [-v] [-u]
Junio C Hamanoc51fede2007-03-12 07:29:20277 [(-c | -C) &lt;commit&gt; | -F &lt;file&gt; | -m &lt;msg&gt; | --amend]
Junio C Hamano0c999702007-12-03 09:57:55278 [--allow-empty] [--no-verify] [-e] [--author &lt;author&gt;]
Junio C Hamano554da792007-12-27 03:29:58279 [--cleanup=&lt;mode&gt;] [--] [[-i | -o ]&lt;file&gt;&#8230;]</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23280</div>
281<h2>DESCRIPTION</h2>
282<div class="sectionbody">
Junio C Hamanobd2b4bb2007-08-06 06:42:24283<p>Use <em>git commit</em> to store the current contents of the index in a new
284commit along with a log message describing the changes you have made.</p>
Junio C Hamanob515b6a2007-08-08 09:21:16285<p>The content to be added can be specified in several ways:</p>
Junio C Hamanoe7935c42006-12-13 21:32:17286<ol>
287<li>
288<p>
Junio C Hamanob515b6a2007-08-08 09:21:16289by using <a href="git-add.html">git-add(1)</a> to incrementally "add" changes to the
290 index before using the <em>commit</em> command (Note: even modified
291 files must be "added");
292</p>
293</li>
294<li>
295<p>
Junio C Hamanobd2b4bb2007-08-06 06:42:24296by using <a href="git-rm.html">git-rm(1)</a> to remove files from the working tree
297 and the index, again before using the <em>commit</em> command;
Junio C Hamanoe7935c42006-12-13 21:32:17298</p>
299</li>
300<li>
301<p>
Junio C Hamanobd2b4bb2007-08-06 06:42:24302by listing files as arguments to the <em>commit</em> command, in which
303 case the commit will ignore changes staged in the index, and instead
304 record the current content of the listed files;
Junio C Hamanoe7935c42006-12-13 21:32:17305</p>
306</li>
307<li>
308<p>
Junio C Hamanobd2b4bb2007-08-06 06:42:24309by using the -a switch with the <em>commit</em> command to automatically
310 "add" changes from all known files (i.e. all files that are already
311 listed in the index) and to automatically "rm" files in the index
312 that have been removed from the working tree, and then perform the
313 actual commit;
Junio C Hamanoe7935c42006-12-13 21:32:17314</p>
315</li>
Junio C Hamanoc51fede2007-03-12 07:29:20316<li>
317<p>
318by using the --interactive switch with the <em>commit</em> command to decide one
319 by one which files should be part of the commit, before finalizing the
320 operation. Currently, this is done by invoking <tt>git-add --interactive</tt>.
321</p>
322</li>
Junio C Hamanoe7935c42006-12-13 21:32:17323</ol>
324<p>The <a href="git-status.html">git-status(1)</a> command can be used to obtain a
325summary of what is included by any of the above for the next
326commit by giving the same set of parameters you would give to
327this command.</p>
328<p>If you make a commit and then found a mistake immediately after
329that, you can recover from it with <a href="git-reset.html">git-reset(1)</a>.</p>
Junio C Hamano1a4e8412005-12-27 08:17:23330</div>
331<h2>OPTIONS</h2>
332<div class="sectionbody">
333<dl>
334<dt>
335-a|--all
336</dt>
337<dd>
338<p>
Junio C Hamanoe7935c42006-12-13 21:32:17339 Tell the command to automatically stage files that have
340 been modified and deleted, but new files you have not
341 told git about are not affected.
Junio C Hamano1a4e8412005-12-27 08:17:23342</p>
343</dd>
344<dt>
345-c or -C &lt;commit&gt;
346</dt>
347<dd>
348<p>
349 Take existing commit object, and reuse the log message
350 and the authorship information (including the timestamp)
351 when creating the commit. With <em>-C</em>, the editor is not
352 invoked; with <em>-c</em> the user can further edit the commit
353 message.
354</p>
355</dd>
356<dt>
357-F &lt;file&gt;
358</dt>
359<dd>
360<p>
361 Take the commit message from the given file. Use <em>-</em> to
362 read the message from the standard input.
363</p>
364</dd>
365<dt>
Junio C Hamano40f2f8d2006-02-07 08:04:39366--author &lt;author&gt;
367</dt>
368<dd>
369<p>
370 Override the author name used in the commit. Use
371 <tt>A U Thor &lt;author@example.com&gt;</tt> format.
372</p>
373</dd>
374<dt>
Junio C Hamano1e6e0062007-07-13 05:33:25375-m &lt;msg&gt;|--message=&lt;msg&gt;
Junio C Hamano1a4e8412005-12-27 08:17:23376</dt>
377<dd>
378<p>
379 Use the given &lt;msg&gt; as the commit message.
380</p>
381</dd>
382<dt>
Junio C Hamanoa3770f92007-07-25 08:53:33383-t &lt;file&gt;|--template=&lt;file&gt;
384</dt>
385<dd>
386<p>
387 Use the contents of the given file as the initial version
388 of the commit message. The editor is invoked and you can
389 make subsequent changes. If a message is specified using
Junio C Hamanob968dbb2007-07-27 07:26:40390 the <tt>-m</tt> or <tt>-F</tt> options, this option has no effect. This
391 overrides the <tt>commit.template</tt> configuration variable.
Junio C Hamanoa3770f92007-07-25 08:53:33392</p>
393</dd>
394<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23395-s|--signoff
396</dt>
397<dd>
398<p>
399 Add Signed-off-by line at the end of the commit message.
400</p>
401</dd>
402<dt>
Junio C Hamanoe7935c42006-12-13 21:32:17403--no-verify
Junio C Hamano1a4e8412005-12-27 08:17:23404</dt>
405<dd>
406<p>
Junio C Hamano942b35e2007-12-09 10:19:33407 This option bypasses the pre-commit and commit-msg hooks.
Junio C Hamano24351a82007-01-13 08:09:17408 See also <a href="hooks.html">hooks</a>.
Junio C Hamano1a4e8412005-12-27 08:17:23409</p>
410</dd>
411<dt>
Junio C Hamano0c999702007-12-03 09:57:55412--allow-empty
413</dt>
414<dd>
415<p>
416 Usually recording a commit that has the exact same tree as its
Junio C Hamano58256872007-12-04 08:31:13417 sole parent commit is a mistake, and the command prevents you
418 from making such a commit. This option bypasses the safety, and
419 is primarily for use by foreign scm interface scripts.
Junio C Hamano0c999702007-12-03 09:57:55420</p>
421</dd>
422<dt>
Junio C Hamano554da792007-12-27 03:29:58423--cleanup=&lt;mode&gt;
424</dt>
425<dd>
426<p>
427 This option sets how the commit message is cleaned up.
428 The <em>&lt;mode&gt;</em> can be one of <em>verbatim</em>, <em>whitespace</em>, <em>strip</em>,
429 and <em>default</em>. The <em>default</em> mode will strip leading and
430 trailing empty lines and #commentary from the commit message
431 only if the message is to be edited. Otherwise only whitespace
432 removed. The <em>verbatim</em> mode does not change message at all,
433 <em>whitespace</em> removes just leading/trailing whitespace lines
434 and <em>strip</em> removes both whitespace and commentary.
435</p>
436</dd>
437<dt>
Junio C Hamano1a4e8412005-12-27 08:17:23438-e|--edit
439</dt>
440<dd>
441<p>
442 The message taken from file with <tt>-F</tt>, command line with
443 <tt>-m</tt>, and from file with <tt>-C</tt> are usually used as the
444 commit log message unmodified. This option lets you
445 further edit the message taken from these sources.
446</p>
447</dd>
448<dt>
Junio C Hamanobfe9e752006-04-05 21:43:28449--amend
450</dt>
451<dd>
452<p>
453 Used to amend the tip of the current branch. Prepare the tree
454 object you would want to replace the latest commit as usual
455 (this includes the usual -i/-o and explicit paths), and the
456 commit log editor is seeded with the commit message from the
457 tip of the current branch. The commit you create replaces the
458 current tip &#8212; if it was a merge, it will have the parents of
459 the current tip as parents &#8212; so the current top commit is
460 discarded.
461</p>
462<p>It is a rough equivalent for:</p>
463<div class="listingblock">
464<div class="content">
465<pre><tt> $ git reset --soft HEAD^
466 $ ... do something else to come up with the right tree ...
Junio C Hamano47ea30e2006-04-05 23:08:03467 $ git commit -c ORIG_HEAD
468</tt></pre>
Junio C Hamanobfe9e752006-04-05 21:43:28469</div></div>
470<p>but can be used to amend a merge commit.</p>
471</dd>
472<dt>
Junio C Hamano40f2f8d2006-02-07 08:04:39473-i|--include
474</dt>
475<dd>
476<p>
Junio C Hamanoe7935c42006-12-13 21:32:17477 Before making a commit out of staged contents so far,
478 stage the contents of paths given on the command line
479 as well. This is usually not what you want unless you
480 are concluding a conflicted merge.
Junio C Hamano6697ac52006-02-14 08:00:23481</p>
482</dd>
483<dt>
Junio C Hamano1e6e0062007-07-13 05:33:25484-u|--untracked-files
485</dt>
486<dd>
487<p>
488 Show all untracked files, also those in uninteresting
489 directories, in the "Untracked files:" section of commit
490 message template. Without this option only its name and
491 a trailing slash are displayed for each untracked
492 directory.
493</p>
494</dd>
495<dt>
496-v|--verbose
497</dt>
498<dd>
499<p>
500 Show unified diff between the HEAD commit and what
501 would be committed at the bottom of the commit message
502 template. Note that this diff output doesn't have its
503 lines prefixed with <em>#</em>.
504</p>
505</dd>
506<dt>
Junio C Hamano7d23f5e2006-12-16 07:44:04507-q|--quiet
508</dt>
509<dd>
510<p>
Junio C Hamanof9771f62007-01-17 17:42:30511 Suppress commit summary message.
Junio C Hamano7d23f5e2006-12-16 07:44:04512</p>
513</dd>
514<dt>
Junio C Hamano1bb569e2006-05-05 23:14:25515--
Junio C Hamano1a4e8412005-12-27 08:17:23516</dt>
517<dd>
518<p>
519 Do not interpret any more arguments as options.
520</p>
521</dd>
522<dt>
523&lt;file&gt;&#8230;
524</dt>
525<dd>
526<p>
Junio C Hamanoe7935c42006-12-13 21:32:17527 When files are given on the command line, the command
528 commits the contents of the named files, without
529 recording the changes already staged. The contents of
530 these files are also staged for the next commit on top
531 of what have been staged before.
Junio C Hamano1a4e8412005-12-27 08:17:23532</p>
533</dd>
534</dl>
Junio C Hamano1a4e8412005-12-27 08:17:23535</div>
Junio C Hamanoe7935c42006-12-13 21:32:17536<h2>EXAMPLES</h2>
Junio C Hamano40f2f8d2006-02-07 08:04:39537<div class="sectionbody">
Junio C Hamanoe7935c42006-12-13 21:32:17538<p>When recording your own work, the contents of modified files in
539your working tree are temporarily stored to a staging area
Junio C Hamano361c1332007-11-14 12:17:22540called the "index" with <a href="git-add.html">git-add(1)</a>. A file can be
541reverted back, only in the index but not in the working tree,
542to that of the last commit with <tt>git-reset HEAD &#8212; &lt;file&gt;</tt>,
543which effectively reverts <tt>git-add</tt> and prevents the changes to
544this file from participating in the next commit. After building
545the state to be committed incrementally with these commands,
546<tt>git commit</tt> (without any pathname parameter) is used to record what
Junio C Hamanoe7935c42006-12-13 21:32:17547has been staged so far. This is the most basic form of the
548command. An example:</p>
549<div class="listingblock">
Junio C Hamano40f2f8d2006-02-07 08:04:39550<div class="content">
Junio C Hamanoe7935c42006-12-13 21:32:17551<pre><tt>$ edit hello.c
552$ git rm goodbye.c
553$ git add hello.c
554$ git commit</tt></pre>
Junio C Hamano40f2f8d2006-02-07 08:04:39555</div></div>
Junio C Hamanoe7935c42006-12-13 21:32:17556<p>Instead of staging files after each individual change, you can
557tell <tt>git commit</tt> to notice the changes to the files whose
558contents are tracked in
559your working tree and do corresponding <tt>git add</tt> and <tt>git rm</tt>
560for you. That is, this example does the same as the earlier
561example if there is no other change in your working tree:</p>
562<div class="listingblock">
563<div class="content">
564<pre><tt>$ edit hello.c
565$ rm goodbye.c
566$ git commit -a</tt></pre>
567</div></div>
568<p>The command <tt>git commit -a</tt> first looks at your working tree,
569notices that you have modified hello.c and removed goodbye.c,
570and performs necessary <tt>git add</tt> and <tt>git rm</tt> for you.</p>
571<p>After staging changes to many files, you can alter the order the
572changes are recorded in, by giving pathnames to <tt>git commit</tt>.
573When pathnames are given, the command makes a commit that
574only records the changes made to the named paths:</p>
575<div class="listingblock">
576<div class="content">
577<pre><tt>$ edit hello.c hello.h
578$ git add hello.c hello.h
579$ edit Makefile
580$ git commit Makefile</tt></pre>
581</div></div>
582<p>This makes a commit that records the modification to <tt>Makefile</tt>.
583The changes staged for <tt>hello.c</tt> and <tt>hello.h</tt> are not included
584in the resulting commit. However, their changes are not lost &#8212;
585they are still staged and merely held back. After the above
586sequence, if you do:</p>
587<div class="listingblock">
588<div class="content">
589<pre><tt>$ git commit</tt></pre>
590</div></div>
591<p>this second commit would record the changes to <tt>hello.c</tt> and
592<tt>hello.h</tt> as expected.</p>
593<p>After a merge (initiated by either <a href="git-merge.html">git-merge(1)</a> or
594<a href="git-pull.html">git-pull(1)</a>) stops because of conflicts, cleanly merged
595paths are already staged to be committed for you, and paths that
596conflicted are left in unmerged state. You would have to first
597check which paths are conflicting with <a href="git-status.html">git-status(1)</a>
598and after fixing them manually in your working tree, you would
599stage the result as usual with <a href="git-add.html">git-add(1)</a>:</p>
600<div class="listingblock">
601<div class="content">
602<pre><tt>$ git status | grep unmerged
603unmerged: hello.c
604$ edit hello.c
605$ git add hello.c</tt></pre>
606</div></div>
607<p>After resolving conflicts and staging the result, <tt>git ls-files -u</tt>
608would stop mentioning the conflicted path. When you are done,
609run <tt>git commit</tt> to finally record the merge:</p>
610<div class="listingblock">
611<div class="content">
612<pre><tt>$ git commit</tt></pre>
613</div></div>
614<p>As with the case to record your own changes, you can use <tt>-a</tt>
615option to save typing. One difference is that during a merge
616resolution, you cannot use <tt>git commit</tt> with pathnames to
617alter the order the changes are committed, because the merge
618should be recorded as a single commit. In fact, the command
619refuses to run when given pathnames (but see <tt>-i</tt> option).</p>
620</div>
Junio C Hamano775a0f42006-12-31 01:19:14621<h2>DISCUSSION</h2>
622<div class="sectionbody">
Junio C Hamano8f76dc62007-01-17 07:24:25623<p>Though not required, it's a good idea to begin the commit message
624with a single short (less than 50 character) line summarizing the
625change, followed by a blank line and then a more thorough description.
626Tools that turn commits into email, for example, use the first line
627on the Subject: line and the rest of the commit in the body.</p>
Junio C Hamano775a0f42006-12-31 01:19:14628<p>At the core level, git is character encoding agnostic.</p>
629<ul>
630<li>
631<p>
632The pathnames recorded in the index and in the tree objects
633 are treated as uninterpreted sequences of non-NUL bytes.
634 What readdir(2) returns are what are recorded and compared
635 with the data git keeps track of, which in turn are expected
636 to be what lstat(2) and creat(2) accepts. There is no such
637 thing as pathname encoding translation.
638</p>
639</li>
640<li>
641<p>
642The contents of the blob objects are uninterpreted sequence
643 of bytes. There is no encoding translation at the core
644 level.
645</p>
646</li>
647<li>
648<p>
649The commit log messages are uninterpreted sequence of non-NUL
650 bytes.
651</p>
652</li>
653</ul>
654<p>Although we encourage that the commit log messages are encoded
655in UTF-8, both the core and git Porcelain are designed not to
656force UTF-8 on projects. If all participants of a particular
657project find it more convenient to use legacy encodings, git
658does not forbid it. However, there are a few things to keep in
659mind.</p>
660<ol>
661<li>
662<p>
663<tt>git-commit-tree</tt> (hence, <tt>git-commit</tt> which uses it) issues
Junio C Hamano14b76482008-01-05 10:32:26664 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:14665 like a valid UTF-8 string, unless you explicitly say your
666 project uses a legacy encoding. The way to say this is to
Junio C Hamano35bb3f62007-02-19 05:35:53667 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:14668</p>
669<div class="listingblock">
670<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:53671<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:14672 commitencoding = ISO-8859-1</tt></pre>
673</div></div>
674<p>Commit objects created with the above setting record the value
Junio C Hamano35bb3f62007-02-19 05:35:53675of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:14676help other people who look at them later. Lack of this header
677implies that the commit log message is encoded in UTF-8.</p>
678</li>
679<li>
680<p>
681<tt>git-log</tt>, <tt>git-show</tt> and friends looks at the <tt>encoding</tt>
682 header of a commit object, and tries to re-code the log
683 message into UTF-8 unless otherwise specified. You can
684 specify the desired output encoding with
Junio C Hamano35bb3f62007-02-19 05:35:53685 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:14686</p>
687<div class="listingblock">
688<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:53689<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:14690 logoutputencoding = ISO-8859-1</tt></pre>
691</div></div>
692<p>If you do not have this configuration variable, the value of
Junio C Hamano35bb3f62007-02-19 05:35:53693<tt>i18n.commitencoding</tt> is used instead.</p>
Junio C Hamano775a0f42006-12-31 01:19:14694</li>
695</ol>
696<p>Note that we deliberately chose not to re-code the commit log
697message when a commit is made to force UTF-8 at the commit
698object level, because re-coding to UTF-8 is not necessarily a
699reversible operation.</p>
700</div>
Junio C Hamanof6002a92007-07-20 10:28:22701<h2>ENVIRONMENT AND CONFIGURATION VARIABLES</h2>
Junio C Hamanoe7935c42006-12-13 21:32:17702<div class="sectionbody">
Junio C Hamanof6002a92007-07-20 10:28:22703<p>The editor used to edit the commit log message will be chosen from the
704GIT_EDITOR environment variable, the core.editor configuration variable, the
705VISUAL environment variable, or the EDITOR environment variable (in that
706order).</p>
Junio C Hamanoe7935c42006-12-13 21:32:17707</div>
708<h2>HOOKS</h2>
709<div class="sectionbody">
Junio C Hamano26e590a2008-02-17 03:53:51710<p>This command can run <tt>commit-msg</tt>, <tt>prepare-commit-msg</tt>, <tt>pre-commit</tt>,
711and <tt>post-commit</tt> hooks. See <a href="hooks.html">hooks</a> for more
Junio C Hamanoe7935c42006-12-13 21:32:17712information.</p>
713</div>
714<h2>SEE ALSO</h2>
715<div class="sectionbody">
716<p><a href="git-add.html">git-add(1)</a>,
717<a href="git-rm.html">git-rm(1)</a>,
718<a href="git-mv.html">git-mv(1)</a>,
719<a href="git-merge.html">git-merge(1)</a>,
720<a href="git-commit-tree.html">git-commit-tree(1)</a></p>
Junio C Hamano40f2f8d2006-02-07 08:04:39721</div>
Junio C Hamano1a4e8412005-12-27 08:17:23722<h2>Author</h2>
723<div class="sectionbody">
724<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt; and
725Junio C Hamano &lt;junkio@cox.net&gt;</p>
726</div>
727<h2>GIT</h2>
728<div class="sectionbody">
729<p>Part of the <a href="git.html">git(7)</a> suite</p>
730</div>
731<div id="footer">
732<div id="footer-text">
Junio C Hamano26e590a2008-02-17 03:53:51733Last updated 17-Feb-2008 03:50:04 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23734</div>
735</div>
736</body>
737</html>