blob: 19da70110a69c1627b89317ff408cd623e0bb6a8 [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 Hamano2fbcd212008-05-14 22:26:07408 See also <a href="githooks.html">githooks(5)</a>[hooks].
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 Hamanoe79159d2008-04-12 08:23:17484-o|--only
485</dt>
486<dd>
487<p>
488 Make a commit only from the paths specified on the
489 command line, disregarding any contents that have been
490 staged so far. This is the default mode of operation of
491 <em>git commit</em> if any paths are given on the command line,
492 in which case this option can be omitted.
493 If this option is specified together with <em>--amend</em>, then
494 no paths need be specified, which can be used to amend
495 the last commit without committing changes that have
496 already been staged.
497</p>
498</dd>
499<dt>
Junio C Hamano1e6e0062007-07-13 05:33:25500-u|--untracked-files
501</dt>
502<dd>
503<p>
504 Show all untracked files, also those in uninteresting
505 directories, in the "Untracked files:" section of commit
506 message template. Without this option only its name and
507 a trailing slash are displayed for each untracked
508 directory.
509</p>
510</dd>
511<dt>
512-v|--verbose
513</dt>
514<dd>
515<p>
516 Show unified diff between the HEAD commit and what
517 would be committed at the bottom of the commit message
518 template. Note that this diff output doesn't have its
519 lines prefixed with <em>#</em>.
520</p>
521</dd>
522<dt>
Junio C Hamano7d23f5e2006-12-16 07:44:04523-q|--quiet
524</dt>
525<dd>
526<p>
Junio C Hamanof9771f62007-01-17 17:42:30527 Suppress commit summary message.
Junio C Hamano7d23f5e2006-12-16 07:44:04528</p>
529</dd>
530<dt>
Junio C Hamano1bb569e2006-05-05 23:14:25531--
Junio C Hamano1a4e8412005-12-27 08:17:23532</dt>
533<dd>
534<p>
535 Do not interpret any more arguments as options.
536</p>
537</dd>
538<dt>
539&lt;file&gt;&#8230;
540</dt>
541<dd>
542<p>
Junio C Hamanoe7935c42006-12-13 21:32:17543 When files are given on the command line, the command
544 commits the contents of the named files, without
545 recording the changes already staged. The contents of
546 these files are also staged for the next commit on top
547 of what have been staged before.
Junio C Hamano1a4e8412005-12-27 08:17:23548</p>
549</dd>
550</dl>
Junio C Hamano1a4e8412005-12-27 08:17:23551</div>
Junio C Hamanoe7935c42006-12-13 21:32:17552<h2>EXAMPLES</h2>
Junio C Hamano40f2f8d2006-02-07 08:04:39553<div class="sectionbody">
Junio C Hamanoe7935c42006-12-13 21:32:17554<p>When recording your own work, the contents of modified files in
555your working tree are temporarily stored to a staging area
Junio C Hamano361c1332007-11-14 12:17:22556called the "index" with <a href="git-add.html">git-add(1)</a>. A file can be
557reverted back, only in the index but not in the working tree,
558to that of the last commit with <tt>git-reset HEAD &#8212; &lt;file&gt;</tt>,
559which effectively reverts <tt>git-add</tt> and prevents the changes to
560this file from participating in the next commit. After building
561the state to be committed incrementally with these commands,
562<tt>git commit</tt> (without any pathname parameter) is used to record what
Junio C Hamanoe7935c42006-12-13 21:32:17563has been staged so far. This is the most basic form of the
564command. An example:</p>
565<div class="listingblock">
Junio C Hamano40f2f8d2006-02-07 08:04:39566<div class="content">
Junio C Hamanoe7935c42006-12-13 21:32:17567<pre><tt>$ edit hello.c
568$ git rm goodbye.c
569$ git add hello.c
570$ git commit</tt></pre>
Junio C Hamano40f2f8d2006-02-07 08:04:39571</div></div>
Junio C Hamanoe7935c42006-12-13 21:32:17572<p>Instead of staging files after each individual change, you can
573tell <tt>git commit</tt> to notice the changes to the files whose
574contents are tracked in
575your working tree and do corresponding <tt>git add</tt> and <tt>git rm</tt>
576for you. That is, this example does the same as the earlier
577example if there is no other change in your working tree:</p>
578<div class="listingblock">
579<div class="content">
580<pre><tt>$ edit hello.c
581$ rm goodbye.c
582$ git commit -a</tt></pre>
583</div></div>
584<p>The command <tt>git commit -a</tt> first looks at your working tree,
585notices that you have modified hello.c and removed goodbye.c,
586and performs necessary <tt>git add</tt> and <tt>git rm</tt> for you.</p>
587<p>After staging changes to many files, you can alter the order the
588changes are recorded in, by giving pathnames to <tt>git commit</tt>.
589When pathnames are given, the command makes a commit that
590only records the changes made to the named paths:</p>
591<div class="listingblock">
592<div class="content">
593<pre><tt>$ edit hello.c hello.h
594$ git add hello.c hello.h
595$ edit Makefile
596$ git commit Makefile</tt></pre>
597</div></div>
598<p>This makes a commit that records the modification to <tt>Makefile</tt>.
599The changes staged for <tt>hello.c</tt> and <tt>hello.h</tt> are not included
600in the resulting commit. However, their changes are not lost &#8212;
601they are still staged and merely held back. After the above
602sequence, if you do:</p>
603<div class="listingblock">
604<div class="content">
605<pre><tt>$ git commit</tt></pre>
606</div></div>
607<p>this second commit would record the changes to <tt>hello.c</tt> and
608<tt>hello.h</tt> as expected.</p>
609<p>After a merge (initiated by either <a href="git-merge.html">git-merge(1)</a> or
610<a href="git-pull.html">git-pull(1)</a>) stops because of conflicts, cleanly merged
611paths are already staged to be committed for you, and paths that
612conflicted are left in unmerged state. You would have to first
613check which paths are conflicting with <a href="git-status.html">git-status(1)</a>
614and after fixing them manually in your working tree, you would
615stage the result as usual with <a href="git-add.html">git-add(1)</a>:</p>
616<div class="listingblock">
617<div class="content">
618<pre><tt>$ git status | grep unmerged
619unmerged: hello.c
620$ edit hello.c
621$ git add hello.c</tt></pre>
622</div></div>
623<p>After resolving conflicts and staging the result, <tt>git ls-files -u</tt>
624would stop mentioning the conflicted path. When you are done,
625run <tt>git commit</tt> to finally record the merge:</p>
626<div class="listingblock">
627<div class="content">
628<pre><tt>$ git commit</tt></pre>
629</div></div>
630<p>As with the case to record your own changes, you can use <tt>-a</tt>
631option to save typing. One difference is that during a merge
632resolution, you cannot use <tt>git commit</tt> with pathnames to
633alter the order the changes are committed, because the merge
634should be recorded as a single commit. In fact, the command
635refuses to run when given pathnames (but see <tt>-i</tt> option).</p>
636</div>
Junio C Hamano775a0f42006-12-31 01:19:14637<h2>DISCUSSION</h2>
638<div class="sectionbody">
Junio C Hamano8f76dc62007-01-17 07:24:25639<p>Though not required, it's a good idea to begin the commit message
640with a single short (less than 50 character) line summarizing the
641change, followed by a blank line and then a more thorough description.
642Tools that turn commits into email, for example, use the first line
643on the Subject: line and the rest of the commit in the body.</p>
Junio C Hamano775a0f42006-12-31 01:19:14644<p>At the core level, git is character encoding agnostic.</p>
645<ul>
646<li>
647<p>
648The pathnames recorded in the index and in the tree objects
649 are treated as uninterpreted sequences of non-NUL bytes.
650 What readdir(2) returns are what are recorded and compared
651 with the data git keeps track of, which in turn are expected
652 to be what lstat(2) and creat(2) accepts. There is no such
653 thing as pathname encoding translation.
654</p>
655</li>
656<li>
657<p>
658The contents of the blob objects are uninterpreted sequence
659 of bytes. There is no encoding translation at the core
660 level.
661</p>
662</li>
663<li>
664<p>
665The commit log messages are uninterpreted sequence of non-NUL
666 bytes.
667</p>
668</li>
669</ul>
670<p>Although we encourage that the commit log messages are encoded
671in UTF-8, both the core and git Porcelain are designed not to
672force UTF-8 on projects. If all participants of a particular
673project find it more convenient to use legacy encodings, git
674does not forbid it. However, there are a few things to keep in
675mind.</p>
676<ol>
677<li>
678<p>
679<tt>git-commit-tree</tt> (hence, <tt>git-commit</tt> which uses it) issues
Junio C Hamano14b76482008-01-05 10:32:26680 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:14681 like a valid UTF-8 string, unless you explicitly say your
682 project uses a legacy encoding. The way to say this is to
Junio C Hamano35bb3f62007-02-19 05:35:53683 have i18n.commitencoding in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:14684</p>
685<div class="listingblock">
686<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:53687<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:14688 commitencoding = ISO-8859-1</tt></pre>
689</div></div>
690<p>Commit objects created with the above setting record the value
Junio C Hamano35bb3f62007-02-19 05:35:53691of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:14692help other people who look at them later. Lack of this header
693implies that the commit log message is encoded in UTF-8.</p>
694</li>
695<li>
696<p>
697<tt>git-log</tt>, <tt>git-show</tt> and friends looks at the <tt>encoding</tt>
698 header of a commit object, and tries to re-code the log
699 message into UTF-8 unless otherwise specified. You can
700 specify the desired output encoding with
Junio C Hamano35bb3f62007-02-19 05:35:53701 <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:14702</p>
703<div class="listingblock">
704<div class="content">
Junio C Hamano35bb3f62007-02-19 05:35:53705<pre><tt>[i18n]
Junio C Hamano775a0f42006-12-31 01:19:14706 logoutputencoding = ISO-8859-1</tt></pre>
707</div></div>
708<p>If you do not have this configuration variable, the value of
Junio C Hamano35bb3f62007-02-19 05:35:53709<tt>i18n.commitencoding</tt> is used instead.</p>
Junio C Hamano775a0f42006-12-31 01:19:14710</li>
711</ol>
712<p>Note that we deliberately chose not to re-code the commit log
713message when a commit is made to force UTF-8 at the commit
714object level, because re-coding to UTF-8 is not necessarily a
715reversible operation.</p>
716</div>
Junio C Hamanof6002a92007-07-20 10:28:22717<h2>ENVIRONMENT AND CONFIGURATION VARIABLES</h2>
Junio C Hamanoe7935c42006-12-13 21:32:17718<div class="sectionbody">
Junio C Hamanof6002a92007-07-20 10:28:22719<p>The editor used to edit the commit log message will be chosen from the
720GIT_EDITOR environment variable, the core.editor configuration variable, the
721VISUAL environment variable, or the EDITOR environment variable (in that
722order).</p>
Junio C Hamanoe7935c42006-12-13 21:32:17723</div>
724<h2>HOOKS</h2>
725<div class="sectionbody">
Junio C Hamano26e590a2008-02-17 03:53:51726<p>This command can run <tt>commit-msg</tt>, <tt>prepare-commit-msg</tt>, <tt>pre-commit</tt>,
Junio C Hamano2fbcd212008-05-14 22:26:07727and <tt>post-commit</tt> hooks. See <a href="githooks.html">githooks(5)</a>[hooks] for more
Junio C Hamanoe7935c42006-12-13 21:32:17728information.</p>
729</div>
730<h2>SEE ALSO</h2>
731<div class="sectionbody">
732<p><a href="git-add.html">git-add(1)</a>,
733<a href="git-rm.html">git-rm(1)</a>,
734<a href="git-mv.html">git-mv(1)</a>,
735<a href="git-merge.html">git-merge(1)</a>,
736<a href="git-commit-tree.html">git-commit-tree(1)</a></p>
Junio C Hamano40f2f8d2006-02-07 08:04:39737</div>
Junio C Hamano1a4e8412005-12-27 08:17:23738<h2>Author</h2>
739<div class="sectionbody">
740<p>Written by Linus Torvalds &lt;torvalds@osdl.org&gt; and
741Junio C Hamano &lt;junkio@cox.net&gt;</p>
742</div>
743<h2>GIT</h2>
744<div class="sectionbody">
745<p>Part of the <a href="git.html">git(7)</a> suite</p>
746</div>
747<div id="footer">
748<div id="footer-text">
Junio C Hamano2fbcd212008-05-14 22:26:07749Last updated 14-May-2008 22:24:40 UTC
Junio C Hamano1a4e8412005-12-27 08:17:23750</div>
751</div>
752</body>
753</html>