blob: 9137c213b72c0e8b18aba6b1ad3e0a88202216c0 [file] [log] [blame]
Junio C Hamano944ce252018-05-30 22:25:261<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamano1a4e8412005-12-27 08:17:232<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9d971152012-12-19 00:43:116<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamano4bea0282022-04-04 18:21:497<meta name="generator" content="AsciiDoc 10.1.2" />
Junio C Hamano60186642010-12-02 14:18:268<title>git-commit(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:239<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:1110/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
11
12/* Default font. */
13body {
14 font-family: Georgia,serif;
15}
16
17/* Title font. */
18h1, h2, h3, h4, h5, h6,
19div.title, caption.title,
20thead, p.table.header,
21#toctitle,
22#author, #revnumber, #revdate, #revremark,
23#footer {
24 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2325}
26
27body {
28 margin: 1em 5% 1em 5%;
29}
30
Junio C Hamanoba4b9282008-07-06 05:20:3131a {
32 color: blue;
33 text-decoration: underline;
34}
35a:visited {
36 color: fuchsia;
37}
Junio C Hamano1a4e8412005-12-27 08:17:2338
39em {
40 font-style: italic;
Junio C Hamano60186642010-12-02 14:18:2641 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2342}
43
44strong {
45 font-weight: bold;
Junio C Hamano60186642010-12-02 14:18:2646 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2347}
48
Junio C Hamano1a4e8412005-12-27 08:17:2349h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2351 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
54}
55
Junio C Hamanoba4b9282008-07-06 05:20:3156h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2357 border-bottom: 2px solid silver;
58}
59h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2360 padding-top: 0.5em;
61}
Junio C Hamanoba4b9282008-07-06 05:20:3162h3 {
63 float: left;
64}
65h3 + * {
66 clear: left;
67}
Junio C Hamano9d971152012-12-19 00:43:1168h5 {
69 font-size: 1.0em;
70}
Junio C Hamano1a4e8412005-12-27 08:17:2371
72div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2373 margin-left: 0;
74}
75
76hr {
77 border: 1px solid silver;
78}
79
80p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
83}
84
Junio C Hamano60186642010-12-02 14:18:2685ul, ol, li > p {
86 margin-top: 0;
87}
Junio C Hamano9d971152012-12-19 00:43:1188ul > li { color: #aaa; }
89ul > li > * { color: black; }
Junio C Hamano60186642010-12-02 14:18:2690
Junio C Hamanoc14e6ad2014-10-31 20:25:5391.monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2395 padding: 0;
96 margin: 0;
97}
Junio C Hamanoc14e6ad2014-10-31 20:25:5398pre {
99 white-space: pre-wrap;
100}
Junio C Hamano1a4e8412005-12-27 08:17:23101
Junio C Hamano9d971152012-12-19 00:43:11102#author {
Junio C Hamano1a4e8412005-12-27 08:17:23103 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23104 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31105 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23106}
Junio C Hamano9d971152012-12-19 00:43:11107#email {
Junio C Hamano1a4e8412005-12-27 08:17:23108}
Junio C Hamano9d971152012-12-19 00:43:11109#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23110}
111
Junio C Hamano9d971152012-12-19 00:43:11112#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
117}
Junio C Hamano9d971152012-12-19 00:43:11118#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23119 float: left;
120 padding-bottom: 0.5em;
121}
Junio C Hamano9d971152012-12-19 00:43:11122#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23123 float: right;
124 padding-bottom: 0.5em;
125}
126
Junio C Hamano9d971152012-12-19 00:43:11127#preamble {
Junio C Hamano60186642010-12-02 14:18:26128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
130}
Junio C Hamano9d971152012-12-19 00:43:11131div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23132div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22134 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23135 margin-bottom: 1.5em;
136}
137div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23142}
143
144div.content { /* Block element content. */
145 padding: 0;
146}
147
148/* Block element titles. */
149div.title, caption.title {
Junio C Hamano60186642010-12-02 14:18:26150 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
155}
156div.title + * {
157 margin-top: 0;
158}
159
160td div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content div.title:first-child {
164 margin-top: 0.0em;
165}
166div.content + div.title {
167 margin-top: 0.0em;
168}
169
170div.sidebarblock > div.content {
171 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23174 padding: 0.5em;
175}
176
177div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23181 padding: 0.5em;
182}
183
Junio C Hamano7bd050f2011-09-22 06:32:22184div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
Junio C Hamano60186642010-12-02 14:18:26187 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11188 border-left: 5px solid #f0f0f0;
189 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23190}
Junio C Hamano7bd050f2011-09-22 06:32:22191
Junio C Hamano60186642010-12-02 14:18:26192div.quoteblock > div.attribution {
193 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23194 text-align: right;
195}
Junio C Hamano60186642010-12-02 14:18:26196
Junio C Hamano9d971152012-12-19 00:43:11197div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
Junio C Hamano60186642010-12-02 14:18:26200}
201div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
204}
205/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31206div.verseblock + div.attribution {
207 text-align: left;
208}
Junio C Hamano1a4e8412005-12-27 08:17:23209
210div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
217}
218div.admonitionblock td.content {
219 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22220 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23221}
222
223div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23226}
227
Junio C Hamano1a4e8412005-12-27 08:17:23228div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53229span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamano60186642010-12-02 14:18:26230a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23231
232dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
235}
236dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
Junio C Hamano60186642010-12-02 14:18:26239 font-style: normal;
240 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242dd > *:first-child {
Junio C Hamano60186642010-12-02 14:18:26243 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23244}
245
246ul, ol {
247 list-style-position: outside;
248}
Junio C Hamano60186642010-12-02 14:18:26249ol.arabic {
250 list-style-type: decimal;
251}
252ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23253 list-style-type: lower-alpha;
254}
Junio C Hamano60186642010-12-02 14:18:26255ol.upperalpha {
256 list-style-type: upper-alpha;
257}
258ol.lowerroman {
259 list-style-type: lower-roman;
260}
261ol.upperroman {
262 list-style-type: upper-roman;
263}
264
265div.compact ul, div.compact ol,
266div.compact p, div.compact p,
267div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
270}
Junio C Hamano1a4e8412005-12-27 08:17:23271
Junio C Hamano1a4e8412005-12-27 08:17:23272tfoot {
273 font-weight: bold;
274}
Junio C Hamano60186642010-12-02 14:18:26275td > div.verse {
276 white-space: pre;
277}
Junio C Hamano60186642010-12-02 14:18:26278
279div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
282}
Junio C Hamano60186642010-12-02 14:18:26283div.hdlist tr {
284 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31285}
Junio C Hamano60186642010-12-02 14:18:26286dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
288}
289td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23290 vertical-align: top;
Junio C Hamano60186642010-12-02 14:18:26291 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23292 padding-right: 0.8em;
Junio C Hamano60186642010-12-02 14:18:26293 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23294}
Junio C Hamano60186642010-12-02 14:18:26295td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23296 vertical-align: top;
297}
Junio C Hamano60186642010-12-02 14:18:26298div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
301}
302
303.comment {
304 background: yellow;
305}
Junio C Hamano1a4e8412005-12-27 08:17:23306
Junio C Hamano7bd050f2011-09-22 06:32:22307.footnote, .footnoteref {
308 font-size: 0.8em;
309}
310
311span.footnote, span.footnoteref {
312 vertical-align: super;
313}
314
315#footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
318}
319
320#footnotes div.footnote {
321 margin: 0 0 5px 0;
322}
323
324#footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
332}
333
Junio C Hamano9d971152012-12-19 00:43:11334div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
338}
339div.colist td img {
340 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23341}
Junio C Hamanoba4b9282008-07-06 05:20:31342
Junio C Hamano9d971152012-12-19 00:43:11343@media print {
344 #footer-badges { display: none; }
345}
346
347#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22348 margin-bottom: 2.5em;
349}
350
Junio C Hamano9d971152012-12-19 00:43:11351#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31352 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
357}
358
Junio C Hamanoc14e6ad2014-10-31 20:25:53359div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31360 margin-top: 0;
361 margin-bottom: 0;
362}
363div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
366}
367div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
370}
371div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
374}
Junio C Hamano9d971152012-12-19 00:43:11375
376span.aqua { color: aqua; }
377span.black { color: black; }
378span.blue { color: blue; }
379span.fuchsia { color: fuchsia; }
380span.gray { color: gray; }
381span.green { color: green; }
382span.lime { color: lime; }
383span.maroon { color: maroon; }
384span.navy { color: navy; }
385span.olive { color: olive; }
386span.purple { color: purple; }
387span.red { color: red; }
388span.silver { color: silver; }
389span.teal { color: teal; }
390span.white { color: white; }
391span.yellow { color: yellow; }
392
393span.aqua-background { background: aqua; }
394span.black-background { background: black; }
395span.blue-background { background: blue; }
396span.fuchsia-background { background: fuchsia; }
397span.gray-background { background: gray; }
398span.green-background { background: green; }
399span.lime-background { background: lime; }
400span.maroon-background { background: maroon; }
401span.navy-background { background: navy; }
402span.olive-background { background: olive; }
403span.purple-background { background: purple; }
404span.red-background { background: red; }
405span.silver-background { background: silver; }
406span.teal-background { background: teal; }
407span.white-background { background: white; }
408span.yellow-background { background: yellow; }
409
410span.big { font-size: 2em; }
411span.small { font-size: 0.6em; }
412
413span.underline { text-decoration: underline; }
414span.overline { text-decoration: overline; }
415span.line-through { text-decoration: line-through; }
416
Junio C Hamanoc14e6ad2014-10-31 20:25:53417div.unbreakable { page-break-inside: avoid; }
418
Junio C Hamano9d971152012-12-19 00:43:11419
420/*
421 * xhtml11 specific
422 *
423 * */
424
425div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
428}
429div.tableblock > table {
430 border: 3px solid #527bbd;
431}
432thead, p.table.header {
433 font-weight: bold;
434 color: #527bbd;
435}
436p.table {
437 margin-top: 0;
438}
Junio C Hamano725b0da2020-01-22 22:02:40439/* Because the table frame attribute is overridden by CSS in most browsers. */
Junio C Hamano9d971152012-12-19 00:43:11440div.tableblock > table[frame="void"] {
441 border-style: none;
442}
443div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
446}
447div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
450}
451
452
453/*
454 * html5 specific
455 *
456 * */
457
458table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
461}
462thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
465}
466p.tableblock {
467 margin-top: 0;
468}
469table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
475}
476th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
481}
482
483table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
486}
487table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
490}
491table.tableblock.frame-none {
492 border-style: hidden;
493}
494
495th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
497}
498th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
500}
501th.tableblock.halign-right, td.tableblock.halign-right {
502 text-align: right;
503}
504
505th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
507}
508th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
510}
511th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
513}
514
515
516/*
517 * manpage specific
518 *
519 * */
520
521body.manpage h1 {
Junio C Hamano60186642010-12-02 14:18:26522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
526}
Junio C Hamano9d971152012-12-19 00:43:11527body.manpage h2 {
Junio C Hamano60186642010-12-02 14:18:26528 border-style: none;
529}
Junio C Hamano9d971152012-12-19 00:43:11530body.manpage div.sectionbody {
531 margin-left: 3em;
Junio C Hamano60186642010-12-02 14:18:26532}
533
534@media print {
Junio C Hamano9d971152012-12-19 00:43:11535 body.manpage div#toc { display: none; }
Junio C Hamano60186642010-12-02 14:18:26536}
Junio C Hamanoc14e6ad2014-10-31 20:25:53537
538
Junio C Hamano1a4e8412005-12-27 08:17:23539</style>
Junio C Hamano7bd050f2011-09-22 06:32:22540<script type="text/javascript">
541/*<![CDATA[*/
Junio C Hamano2b153182021-12-15 21:00:31542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
728}
729
730}
Junio C Hamano9d971152012-12-19 00:43:11731asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22732/*]]>*/
733</script>
Junio C Hamano1a4e8412005-12-27 08:17:23734</head>
Junio C Hamano9d971152012-12-19 00:43:11735<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23736<div id="header">
737<h1>
738git-commit(1) Manual Page
739</h1>
740<h2>NAME</h2>
741<div class="sectionbody">
742<p>git-commit -
Junio C Hamano7c73c662007-01-19 00:37:50743 Record changes to the repository
Junio C Hamano1a4e8412005-12-27 08:17:23744</p>
745</div>
746</div>
Junio C Hamano7bd050f2011-09-22 06:32:22747<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11748<div class="sect1">
Junio C Hamano60186642010-12-02 14:18:26749<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23750<div class="sectionbody">
Junio C Hamano235a91e2006-01-07 01:13:58751<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11752<pre class="content"><em>git commit</em> [-a | --interactive | --patch] [-s] [-v] [-u&lt;mode&gt;] [--amend]
Junio C Hamanoaae21c92021-03-26 22:47:14753 [--dry-run] [(-c | -C | --squash) &lt;commit&gt; | --fixup [(amend|reword):]&lt;commit&gt;)]
Junio C Hamano3d050d62011-05-17 06:43:34754 [-F &lt;file&gt; | -m &lt;msg&gt;] [--reset-author] [--allow-empty]
755 [--allow-empty-message] [--no-verify] [-e] [--author=&lt;author&gt;]
Junio C Hamano3d1b5a12013-05-17 23:34:02756 [--date=&lt;date&gt;] [--cleanup=&lt;mode&gt;] [--[no-]status]
Junio C Hamanob4896852019-12-10 23:15:09757 [-i | -o] [--pathspec-from-file=&lt;file&gt; [--pathspec-file-nul]]
Junio C Hamano69bbb1f2021-04-08 00:21:04758 [(--trailer &lt;token&gt;[(=|:)&lt;value&gt;])&#8230;] [-S[&lt;keyid&gt;]]
759 [--] [&lt;pathspec&gt;&#8230;]</pre>
Junio C Hamano9d971152012-12-19 00:43:11760<div class="attribution">
Junio C Hamano60186642010-12-02 14:18:26761</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23762</div>
Junio C Hamano9d971152012-12-19 00:43:11763</div>
764<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31765<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23766<div class="sectionbody">
Junio C Hamano23168ef2019-02-07 07:20:47767<div class="paragraph"><p>Create a new commit containing the current contents of the index and
768the given log message describing the changes. The new commit is a
769direct child of HEAD, usually the tip of the current branch, and the
770branch is updated to point to it (unless no branch is associated with
771the working tree, in which case HEAD is "detached" as described in
772<a href="git-checkout.html">git-checkout(1)</a>).</p></div>
773<div class="paragraph"><p>The content to be committed can be specified in several ways:</p></div>
Junio C Hamano60186642010-12-02 14:18:26774<div class="olist arabic"><ol class="arabic">
Junio C Hamanoe7935c42006-12-13 21:32:17775<li>
776<p>
Junio C Hamano23168ef2019-02-07 07:20:47777by using <a href="git-add.html">git-add(1)</a> to incrementally "add" changes to the
778 index before using the <em>commit</em> command (Note: even modified files
779 must be "added");
Junio C Hamanob515b6a2007-08-08 09:21:16780</p>
781</li>
782<li>
783<p>
Junio C Hamano23168ef2019-02-07 07:20:47784by using <a href="git-rm.html">git-rm(1)</a> to remove files from the working tree
Junio C Hamanobd2b4bb2007-08-06 06:42:24785 and the index, again before using the <em>commit</em> command;
Junio C Hamanoe7935c42006-12-13 21:32:17786</p>
787</li>
788<li>
789<p>
Junio C Hamanoc0859f72016-10-17 22:22:57790by listing files as arguments to the <em>commit</em> command
791 (without --interactive or --patch switch), in which
Junio C Hamanobd2b4bb2007-08-06 06:42:24792 case the commit will ignore changes staged in the index, and instead
Junio C Hamano50819852008-11-19 02:07:56793 record the current content of the listed files (which must already
Junio C Hamano076ffcc2013-02-06 05:13:21794 be known to Git);
Junio C Hamanoe7935c42006-12-13 21:32:17795</p>
796</li>
797<li>
798<p>
Junio C Hamanobd2b4bb2007-08-06 06:42:24799by using the -a switch with the <em>commit</em> command to automatically
800 "add" changes from all known files (i.e. all files that are already
801 listed in the index) and to automatically "rm" files in the index
802 that have been removed from the working tree, and then perform the
803 actual commit;
Junio C Hamanoe7935c42006-12-13 21:32:17804</p>
805</li>
Junio C Hamanoc51fede2007-03-12 07:29:20806<li>
807<p>
Junio C Hamano3d050d62011-05-17 06:43:34808by using the --interactive or --patch switches with the <em>commit</em> command
Junio C Hamanoc0859f72016-10-17 22:22:57809 to decide one by one which files or hunks should be part of the commit
810 in addition to contents in the index,
Junio C Hamanob76a6862012-05-02 22:02:46811 before finalizing the operation. See the &#8220;Interactive Mode&#8221; section of
Junio C Hamanoa28a9202012-06-21 07:08:23812 <a href="git-add.html">git-add(1)</a> to learn how to operate these modes.
Junio C Hamanoc51fede2007-03-12 07:29:20813</p>
814</li>
Junio C Hamanoba4b9282008-07-06 05:20:31815</ol></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:53816<div class="paragraph"><p>The <code>--dry-run</code> option can be used to obtain a
Junio C Hamanoe7935c42006-12-13 21:32:17817summary of what is included by any of the above for the next
Junio C Hamano1bb31992009-08-29 04:24:08818commit by giving the same set of parameters (options and paths).</p></div>
Junio C Hamano60186642010-12-02 14:18:26819<div class="paragraph"><p>If you make a commit and then find a mistake immediately after
Junio C Hamano1aa40d22010-01-21 17:46:43820that, you can recover from it with <em>git reset</em>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23821</div>
Junio C Hamano9d971152012-12-19 00:43:11822</div>
823<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31824<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23825<div class="sectionbody">
Junio C Hamano60186642010-12-02 14:18:26826<div class="dlist"><dl>
827<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47828-a
829</dt>
Junio C Hamano60186642010-12-02 14:18:26830<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47831--all
Junio C Hamano1a4e8412005-12-27 08:17:23832</dt>
833<dd>
834<p>
Junio C Hamanoe7935c42006-12-13 21:32:17835 Tell the command to automatically stage files that have
836 been modified and deleted, but new files you have not
Junio C Hamano076ffcc2013-02-06 05:13:21837 told Git about are not affected.
Junio C Hamano1a4e8412005-12-27 08:17:23838</p>
839</dd>
Junio C Hamano60186642010-12-02 14:18:26840<dt class="hdlist1">
Junio C Hamano3d050d62011-05-17 06:43:34841-p
842</dt>
843<dt class="hdlist1">
844--patch
845</dt>
846<dd>
847<p>
Junio C Hamano91a411f2021-07-14 00:40:50848 Use the interactive patch selection interface to choose
Junio C Hamanoa28a9202012-06-21 07:08:23849 which changes to commit. See <a href="git-add.html">git-add(1)</a> for
Junio C Hamano3d050d62011-05-17 06:43:34850 details.
851</p>
852</dd>
853<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47854-C &lt;commit&gt;
855</dt>
Junio C Hamano60186642010-12-02 14:18:26856<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47857--reuse-message=&lt;commit&gt;
Junio C Hamano1a4e8412005-12-27 08:17:23858</dt>
859<dd>
860<p>
Junio C Hamanoeb415992008-06-08 22:49:47861 Take an existing commit object, and reuse the log message
Junio C Hamano1a4e8412005-12-27 08:17:23862 and the authorship information (including the timestamp)
Junio C Hamanoeb415992008-06-08 22:49:47863 when creating the commit.
864</p>
865</dd>
Junio C Hamano60186642010-12-02 14:18:26866<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47867-c &lt;commit&gt;
868</dt>
Junio C Hamano60186642010-12-02 14:18:26869<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47870--reedit-message=&lt;commit&gt;
871</dt>
872<dd>
873<p>
Junio C Hamano92d80372016-07-13 22:00:05874 Like <em>-C</em>, but with <code>-c</code> the editor is invoked, so that
Junio C Hamanoeb415992008-06-08 22:49:47875 the user can further edit the commit message.
Junio C Hamano1a4e8412005-12-27 08:17:23876</p>
877</dd>
Junio C Hamano60186642010-12-02 14:18:26878<dt class="hdlist1">
Junio C Hamanoaae21c92021-03-26 22:47:14879--fixup=[(amend|reword):]&lt;commit&gt;
Junio C Hamano2e6ded82010-12-05 06:20:48880</dt>
881<dd>
882<p>
Junio C Hamanoaae21c92021-03-26 22:47:14883 Create a new commit which "fixes up" <code>&lt;commit&gt;</code> when applied with
884 <code>git rebase --autosquash</code>. Plain <code>--fixup=&lt;commit&gt;</code> creates a
885 "fixup!" commit which changes the content of <code>&lt;commit&gt;</code> but leaves
886 its log message untouched. <code>--fixup=amend:&lt;commit&gt;</code> is similar but
887 creates an "amend!" commit which also replaces the log message of
888 <code>&lt;commit&gt;</code> with the log message of the "amend!" commit.
889 <code>--fixup=reword:&lt;commit&gt;</code> creates an "amend!" commit which
890 replaces the log message of <code>&lt;commit&gt;</code> with its own log message
891 but makes no changes to the content of <code>&lt;commit&gt;</code>.
Junio C Hamano2e6ded82010-12-05 06:20:48892</p>
Junio C Hamanoaae21c92021-03-26 22:47:14893<div class="paragraph"><p>The commit created by plain <code>--fixup=&lt;commit&gt;</code> has a subject
894composed of "fixup!" followed by the subject line from &lt;commit&gt;,
895and is recognized specially by <code>git rebase --autosquash</code>. The <code>-m</code>
896option may be used to supplement the log message of the created
897commit, but the additional commentary will be thrown away once the
898"fixup!" commit is squashed into <code>&lt;commit&gt;</code> by
899<code>git rebase --autosquash</code>.</p></div>
900<div class="paragraph"><p>The commit created by <code>--fixup=amend:&lt;commit&gt;</code> is similar but its
901subject is instead prefixed with "amend!". The log message of
902&lt;commit&gt; is copied into the log message of the "amend!" commit and
903opened in an editor so it can be refined. When <code>git rebase
904--autosquash</code> squashes the "amend!" commit into <code>&lt;commit&gt;</code>, the
905log message of <code>&lt;commit&gt;</code> is replaced by the refined log message
906from the "amend!" commit. It is an error for the "amend!" commit&#8217;s
907log message to be empty unless <code>--allow-empty-message</code> is
908specified.</p></div>
909<div class="paragraph"><p><code>--fixup=reword:&lt;commit&gt;</code> is shorthand for <code>--fixup=amend:&lt;commit&gt;
910--only</code>. It creates an "amend!" commit with only a log message
911(ignoring any changes staged in the index). When squashed by <code>git
912rebase --autosquash</code>, it replaces the log message of <code>&lt;commit&gt;</code>
913without making any other changes.</p></div>
914<div class="paragraph"><p>Neither "fixup!" nor "amend!" commits change authorship of
915<code>&lt;commit&gt;</code> when applied by <code>git rebase --autosquash</code>.
916See <a href="git-rebase.html">git-rebase(1)</a> for details.</p></div>
Junio C Hamano2e6ded82010-12-05 06:20:48917</dd>
918<dt class="hdlist1">
919--squash=&lt;commit&gt;
920</dt>
921<dd>
922<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:53923 Construct a commit message for use with <code>rebase --autosquash</code>.
Junio C Hamano2e6ded82010-12-05 06:20:48924 The commit message subject line is taken from the specified
925 commit with a prefix of "squash! ". Can be used with additional
Junio C Hamanoc14e6ad2014-10-31 20:25:53926 commit message options (<code>-m</code>/<code>-c</code>/<code>-C</code>/<code>-F</code>). See
Junio C Hamanoa28a9202012-06-21 07:08:23927 <a href="git-rebase.html">git-rebase(1)</a> for details.
Junio C Hamano2e6ded82010-12-05 06:20:48928</p>
929</dd>
930<dt class="hdlist1">
Junio C Hamano2bd8a742009-12-01 21:16:59931--reset-author
932</dt>
933<dd>
934<p>
Junio C Hamanoa8cc1d82011-03-10 01:18:12935 When used with -C/-c/--amend options, or when committing after a
Junio C Hamano4c60d9a2017-05-04 14:36:22936 conflicting cherry-pick, declare that the authorship of the
Junio C Hamano85f1fde2015-06-01 20:37:32937 resulting commit now belongs to the committer. This also renews
Junio C Hamanoa8cc1d82011-03-10 01:18:12938 the author timestamp.
Junio C Hamano2bd8a742009-12-01 21:16:59939</p>
940</dd>
Junio C Hamano60186642010-12-02 14:18:26941<dt class="hdlist1">
Junio C Hamanoa0fae262009-12-28 09:33:50942--short
943</dt>
944<dd>
945<p>
946 When doing a dry-run, give the output in the short-format. See
Junio C Hamanoc14e6ad2014-10-31 20:25:53947 <a href="git-status.html">git-status(1)</a> for details. Implies <code>--dry-run</code>.
Junio C Hamanoa0fae262009-12-28 09:33:50948</p>
949</dd>
Junio C Hamano60186642010-12-02 14:18:26950<dt class="hdlist1">
Junio C Hamano9257a332012-06-25 20:01:02951--branch
952</dt>
953<dd>
954<p>
955 Show the branch and tracking info even in short-format.
956</p>
957</dd>
958<dt class="hdlist1">
Junio C Hamanoa0fae262009-12-28 09:33:50959--porcelain
960</dt>
961<dd>
962<p>
963 When doing a dry-run, give the output in a porcelain-ready
Junio C Hamanoa28a9202012-06-21 07:08:23964 format. See <a href="git-status.html">git-status(1)</a> for details. Implies
Junio C Hamanoc14e6ad2014-10-31 20:25:53965 <code>--dry-run</code>.
Junio C Hamanoa0fae262009-12-28 09:33:50966</p>
967</dd>
Junio C Hamano60186642010-12-02 14:18:26968<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:04969--long
970</dt>
971<dd>
972<p>
Junio C Hamano4c60d9a2017-05-04 14:36:22973 When doing a dry-run, give the output in the long-format.
Junio C Hamanoc14e6ad2014-10-31 20:25:53974 Implies <code>--dry-run</code>.
Junio C Hamanoa1295452012-11-13 22:32:04975</p>
976</dd>
977<dt class="hdlist1">
Junio C Hamanoa0fae262009-12-28 09:33:50978-z
979</dt>
Junio C Hamano9257a332012-06-25 20:01:02980<dt class="hdlist1">
981--null
982</dt>
Junio C Hamanoa0fae262009-12-28 09:33:50983<dd>
984<p>
Junio C Hamano0f6f3bf2017-03-13 07:01:53985 When showing <code>short</code> or <code>porcelain</code> status output, print the
986 filename verbatim and terminate the entries with NUL, instead of LF.
987 If no format is given, implies the <code>--porcelain</code> output format.
988 Without the <code>-z</code> option, filenames with "unusual" characters are
989 quoted as explained for the configuration variable <code>core.quotePath</code>
990 (see <a href="git-config.html">git-config(1)</a>).
Junio C Hamanoa0fae262009-12-28 09:33:50991</p>
992</dd>
Junio C Hamano60186642010-12-02 14:18:26993<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23994-F &lt;file&gt;
995</dt>
Junio C Hamano60186642010-12-02 14:18:26996<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47997--file=&lt;file&gt;
998</dt>
Junio C Hamano1a4e8412005-12-27 08:17:23999<dd>
1000<p>
1001 Take the commit message from the given file. Use <em>-</em> to
1002 read the message from the standard input.
1003</p>
1004</dd>
Junio C Hamano60186642010-12-02 14:18:261005<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471006--author=&lt;author&gt;
Junio C Hamano40f2f8d2006-02-07 08:04:391007</dt>
1008<dd>
1009<p>
Junio C Hamano13002fb2010-06-08 05:53:581010 Override the commit author. Specify an explicit author using the
Junio C Hamanoc14e6ad2014-10-31 20:25:531011 standard <code>A U Thor &lt;author@example.com&gt;</code> format. Otherwise &lt;author&gt;
Junio C Hamano13002fb2010-06-08 05:53:581012 is assumed to be a pattern and is used to search for an existing
1013 commit by that author (i.e. rev-list --all -i --author=&lt;author&gt;);
1014 the commit author is then copied from the first such commit found.
Junio C Hamano40f2f8d2006-02-07 08:04:391015</p>
1016</dd>
Junio C Hamano60186642010-12-02 14:18:261017<dt class="hdlist1">
Junio C Hamanoae05fee2010-01-08 07:39:461018--date=&lt;date&gt;
1019</dt>
1020<dd>
1021<p>
1022 Override the author date used in the commit.
1023</p>
1024</dd>
Junio C Hamano60186642010-12-02 14:18:261025<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471026-m &lt;msg&gt;
1027</dt>
Junio C Hamano60186642010-12-02 14:18:261028<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471029--message=&lt;msg&gt;
Junio C Hamano1a4e8412005-12-27 08:17:231030</dt>
1031<dd>
1032<p>
1033 Use the given &lt;msg&gt; as the commit message.
Junio C Hamanoc14e6ad2014-10-31 20:25:531034 If multiple <code>-m</code> options are given, their values are
Junio C Hamano09cfe6f2013-03-27 22:10:421035 concatenated as separate paragraphs.
Junio C Hamano1a4e8412005-12-27 08:17:231036</p>
Junio C Hamano7b9cce92018-01-23 22:34:271037<div class="paragraph"><p>The <code>-m</code> option is mutually exclusive with <code>-c</code>, <code>-C</code>, and <code>-F</code>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231038</dd>
Junio C Hamano60186642010-12-02 14:18:261039<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471040-t &lt;file&gt;
1041</dt>
Junio C Hamano60186642010-12-02 14:18:261042<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471043--template=&lt;file&gt;
Junio C Hamanoa3770f92007-07-25 08:53:331044</dt>
1045<dd>
1046<p>
Junio C Hamano51f87de2012-04-16 21:18:541047 When editing the commit message, start the editor with the
Junio C Hamanoc14e6ad2014-10-31 20:25:531048 contents in the given file. The <code>commit.template</code> configuration
Junio C Hamano51f87de2012-04-16 21:18:541049 variable is often used to give this option implicitly to the
1050 command. This mechanism can be used by projects that want to
1051 guide participants with some hints on what to write in the message
1052 in what order. If the user exits the editor without editing the
1053 message, the commit is aborted. This has no effect when a message
Junio C Hamanoc14e6ad2014-10-31 20:25:531054 is given by other means, e.g. with the <code>-m</code> or <code>-F</code> options.
Junio C Hamanoa3770f92007-07-25 08:53:331055</p>
1056</dd>
Junio C Hamano60186642010-12-02 14:18:261057<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471058-s
1059</dt>
Junio C Hamano60186642010-12-02 14:18:261060<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471061--signoff
Junio C Hamano1a4e8412005-12-27 08:17:231062</dt>
Junio C Hamanodf3d3cd2020-11-02 22:05:051063<dt class="hdlist1">
1064--no-signoff
1065</dt>
Junio C Hamano1a4e8412005-12-27 08:17:231066<dd>
1067<p>
Junio C Hamanodf3d3cd2020-11-02 22:05:051068 Add a <code>Signed-off-by</code> trailer by the committer at the end of the commit
1069 log message. The meaning of a signoff depends on the project
1070 to which you&#8217;re committing. For example, it may certify that
1071 the committer has the rights to submit the work under the
1072 project&#8217;s license or agrees to some contributor representation,
1073 such as a Developer Certificate of Origin.
1074 (See <a href="http://developercertificate.org">http://developercertificate.org</a> for the one used by the
1075 Linux kernel and Git projects.) Consult the documentation or
1076 leadership of the project to which you&#8217;re contributing to
1077 understand how the signoffs are used in that project.
Junio C Hamano1a4e8412005-12-27 08:17:231078</p>
Junio C Hamanodf3d3cd2020-11-02 22:05:051079<div class="paragraph"><p>The --no-signoff option can be used to countermand an earlier --signoff
1080option on the command line.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231081</dd>
Junio C Hamano60186642010-12-02 14:18:261082<dt class="hdlist1">
Junio C Hamano69bbb1f2021-04-08 00:21:041083--trailer &lt;token&gt;[(=|:)&lt;value&gt;]
1084</dt>
1085<dd>
1086<p>
1087 Specify a (&lt;token&gt;, &lt;value&gt;) pair that should be applied as a
1088 trailer. (e.g. <code>git commit --trailer "Signed-off-by:C O Mitter \
1089 &lt;committer@example.com&gt;" --trailer "Helped-by:C O Mitter \
1090 &lt;committer@example.com&gt;"</code> will add the "Signed-off-by" trailer
1091 and the "Helped-by" trailer to the commit message.)
1092 The <code>trailer.*</code> configuration variables
1093 (<a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>) can be used to define if
1094 a duplicated trailer is omitted, where in the run of trailers
1095 each trailer would appear, and other details.
1096</p>
1097</dd>
1098<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471099-n
1100</dt>
Junio C Hamano60186642010-12-02 14:18:261101<dt class="hdlist1">
Junio C Hamano5dbbd5d2021-11-04 20:22:311102--[no-]verify
Junio C Hamano1a4e8412005-12-27 08:17:231103</dt>
1104<dd>
1105<p>
Junio C Hamano5dbbd5d2021-11-04 20:22:311106 By default, the pre-commit and commit-msg hooks are run.
1107 When any of <code>--no-verify</code> or <code>-n</code> is given, these are bypassed.
Junio C Hamanoa28a9202012-06-21 07:08:231108 See also <a href="githooks.html">githooks(5)</a>.
Junio C Hamano1a4e8412005-12-27 08:17:231109</p>
1110</dd>
Junio C Hamano60186642010-12-02 14:18:261111<dt class="hdlist1">
Junio C Hamano0c999702007-12-03 09:57:551112--allow-empty
1113</dt>
1114<dd>
1115<p>
1116 Usually recording a commit that has the exact same tree as its
Junio C Hamano58256872007-12-04 08:31:131117 sole parent commit is a mistake, and the command prevents you
1118 from making such a commit. This option bypasses the safety, and
Junio C Hamano619596a2010-08-18 22:15:351119 is primarily for use by foreign SCM interface scripts.
Junio C Hamano0c999702007-12-03 09:57:551120</p>
1121</dd>
Junio C Hamano60186642010-12-02 14:18:261122<dt class="hdlist1">
Junio C Hamanocb39aea2010-05-09 07:24:481123--allow-empty-message
1124</dt>
1125<dd>
1126<p>
1127 Like --allow-empty this command is primarily for use by foreign
Junio C Hamano619596a2010-08-18 22:15:351128 SCM interface scripts. It allows you to create a commit with an
Junio C Hamanocb39aea2010-05-09 07:24:481129 empty commit message without using plumbing commands like
Junio C Hamanoa28a9202012-06-21 07:08:231130 <a href="git-commit-tree.html">git-commit-tree(1)</a>.
Junio C Hamanocb39aea2010-05-09 07:24:481131</p>
1132</dd>
Junio C Hamano60186642010-12-02 14:18:261133<dt class="hdlist1">
Junio C Hamano554da792007-12-27 03:29:581134--cleanup=&lt;mode&gt;
1135</dt>
1136<dd>
1137<p>
Junio C Hamano5e7f1312013-03-21 22:49:011138 This option determines how the supplied commit message should be
Junio C Hamanoc14e6ad2014-10-31 20:25:531139 cleaned up before committing. The <em>&lt;mode&gt;</em> can be <code>strip</code>,
1140 <code>whitespace</code>, <code>verbatim</code>, <code>scissors</code> or <code>default</code>.
Junio C Hamano554da792007-12-27 03:29:581141</p>
Junio C Hamano5e7f1312013-03-21 22:49:011142<div class="openblock">
1143<div class="content">
1144<div class="dlist"><dl>
1145<dt class="hdlist1">
1146strip
1147</dt>
1148<dd>
1149<p>
Junio C Hamanoe1b28592015-05-19 21:26:171150 Strip leading and trailing empty lines, trailing whitespace,
1151 commentary and collapse consecutive empty lines.
Junio C Hamano5e7f1312013-03-21 22:49:011152</p>
1153</dd>
1154<dt class="hdlist1">
1155whitespace
1156</dt>
1157<dd>
1158<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531159 Same as <code>strip</code> except #commentary is not removed.
Junio C Hamano5e7f1312013-03-21 22:49:011160</p>
1161</dd>
1162<dt class="hdlist1">
1163verbatim
1164</dt>
1165<dd>
1166<p>
1167 Do not change the message at all.
1168</p>
1169</dd>
1170<dt class="hdlist1">
Junio C Hamano3214e5f2014-03-25 19:54:381171scissors
1172</dt>
1173<dd>
1174<p>
Junio C Hamanobb34c102017-07-21 22:42:281175 Same as <code>whitespace</code> except that everything from (and including)
1176 the line found below is truncated, if the message is to be edited.
1177 "<code>#</code>" can be customized with core.commentChar.
Junio C Hamano3214e5f2014-03-25 19:54:381178</p>
Junio C Hamanobb34c102017-07-21 22:42:281179<div class="literalblock">
1180<div class="content">
1181<pre><code># ------------------------ &gt;8 ------------------------</code></pre>
1182</div></div>
Junio C Hamano3214e5f2014-03-25 19:54:381183</dd>
1184<dt class="hdlist1">
Junio C Hamano5e7f1312013-03-21 22:49:011185default
1186</dt>
1187<dd>
1188<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531189 Same as <code>strip</code> if the message is to be edited.
1190 Otherwise <code>whitespace</code>.
Junio C Hamano5e7f1312013-03-21 22:49:011191</p>
1192</dd>
1193</dl></div>
1194</div></div>
Junio C Hamano042f2142016-06-27 18:05:051195<div class="paragraph"><p>The default can be changed by the <code>commit.cleanup</code> configuration
Junio C Hamano5e7f1312013-03-21 22:49:011196variable (see <a href="git-config.html">git-config(1)</a>).</p></div>
Junio C Hamano554da792007-12-27 03:29:581197</dd>
Junio C Hamano60186642010-12-02 14:18:261198<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471199-e
1200</dt>
Junio C Hamano60186642010-12-02 14:18:261201<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471202--edit
Junio C Hamano1a4e8412005-12-27 08:17:231203</dt>
1204<dd>
1205<p>
Junio C Hamanoc14e6ad2014-10-31 20:25:531206 The message taken from file with <code>-F</code>, command line with
1207 <code>-m</code>, and from commit object with <code>-C</code> are usually used as
Junio C Hamanoc097e562013-05-03 23:06:121208 the commit log message unmodified. This option lets you
Junio C Hamano1a4e8412005-12-27 08:17:231209 further edit the message taken from these sources.
1210</p>
1211</dd>
Junio C Hamano60186642010-12-02 14:18:261212<dt class="hdlist1">
Junio C Hamano4eb2b9c2012-11-15 21:12:291213--no-edit
1214</dt>
1215<dd>
1216<p>
1217 Use the selected commit message without launching an editor.
Junio C Hamanoc14e6ad2014-10-31 20:25:531218 For example, <code>git commit --amend --no-edit</code> amends a commit
Junio C Hamano4eb2b9c2012-11-15 21:12:291219 without changing its commit message.
1220</p>
1221</dd>
1222<dt class="hdlist1">
Junio C Hamanobfe9e752006-04-05 21:43:281223--amend
1224</dt>
1225<dd>
1226<p>
Junio C Hamano63b6fdb2013-04-07 23:37:131227 Replace the tip of the current branch by creating a new
1228 commit. The recorded tree is prepared as usual (including
Junio C Hamanoc14e6ad2014-10-31 20:25:531229 the effect of the <code>-i</code> and <code>-o</code> options and explicit
Junio C Hamano63b6fdb2013-04-07 23:37:131230 pathspec), and the message from the original commit is used
1231 as the starting point, instead of an empty message, when no
1232 other message is specified from the command line via options
Junio C Hamanoc14e6ad2014-10-31 20:25:531233 such as <code>-m</code>, <code>-F</code>, <code>-c</code>, etc. The new commit has the same
1234 parents and author as the current one (the <code>--reset-author</code>
Junio C Hamano63b6fdb2013-04-07 23:37:131235 option can countermand this).
Junio C Hamanobfe9e752006-04-05 21:43:281236</p>
Junio C Hamano9d971152012-12-19 00:43:111237<div class="openblock">
1238<div class="content">
Junio C Hamano4eb2b9c2012-11-15 21:12:291239<div class="paragraph"><p>It is a rough equivalent for:</p></div>
1240<div class="listingblock">
1241<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531242<pre><code> $ git reset --soft HEAD^
Junio C Hamano4eb2b9c2012-11-15 21:12:291243 $ ... do something else to come up with the right tree ...
Junio C Hamanoc14e6ad2014-10-31 20:25:531244 $ git commit -c ORIG_HEAD</code></pre>
Junio C Hamano4eb2b9c2012-11-15 21:12:291245</div></div>
1246<div class="paragraph"><p>but can be used to amend a merge commit.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111247</div></div>
Junio C Hamano4eb2b9c2012-11-15 21:12:291248<div class="paragraph"><p>You should understand the implications of rewriting history if you
1249amend a commit that has already been published. (See the "RECOVERING
1250FROM UPSTREAM REBASE" section in <a href="git-rebase.html">git-rebase(1)</a>.)</p></div>
Junio C Hamano9257a332012-06-25 20:01:021251</dd>
1252<dt class="hdlist1">
1253--no-post-rewrite
1254</dt>
1255<dd>
1256<p>
1257 Bypass the post-rewrite hook.
1258</p>
1259</dd>
Junio C Hamano60186642010-12-02 14:18:261260<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471261-i
1262</dt>
Junio C Hamano60186642010-12-02 14:18:261263<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471264--include
Junio C Hamano40f2f8d2006-02-07 08:04:391265</dt>
1266<dd>
1267<p>
Junio C Hamanoe7935c42006-12-13 21:32:171268 Before making a commit out of staged contents so far,
1269 stage the contents of paths given on the command line
1270 as well. This is usually not what you want unless you
1271 are concluding a conflicted merge.
Junio C Hamano6697ac52006-02-14 08:00:231272</p>
1273</dd>
Junio C Hamano60186642010-12-02 14:18:261274<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471275-o
1276</dt>
Junio C Hamano60186642010-12-02 14:18:261277<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471278--only
Junio C Hamanoe79159d2008-04-12 08:23:171279</dt>
1280<dd>
1281<p>
Junio C Hamano19a0f4e2014-11-18 21:46:361282 Make a commit by taking the updated working tree contents
1283 of the paths specified on the
Junio C Hamanoe79159d2008-04-12 08:23:171284 command line, disregarding any contents that have been
Junio C Hamano19a0f4e2014-11-18 21:46:361285 staged for other paths. This is the default mode of operation of
Junio C Hamano1aa40d22010-01-21 17:46:431286 <em>git commit</em> if any paths are given on the command line,
Junio C Hamanoe79159d2008-04-12 08:23:171287 in which case this option can be omitted.
Junio C Hamano92d80372016-07-13 22:00:051288 If this option is specified together with <code>--amend</code>, then
Junio C Hamano54bf1e22008-12-20 06:30:111289 no paths need to be specified, which can be used to amend
Junio C Hamanoe79159d2008-04-12 08:23:171290 the last commit without committing changes that have
Junio C Hamano52b1cfb2016-12-20 00:18:361291 already been staged. If used together with <code>--allow-empty</code>
1292 paths are also not required, and an empty commit will be created.
Junio C Hamanoe79159d2008-04-12 08:23:171293</p>
1294</dd>
Junio C Hamano60186642010-12-02 14:18:261295<dt class="hdlist1">
Junio C Hamanob4896852019-12-10 23:15:091296--pathspec-from-file=&lt;file&gt;
1297</dt>
1298<dd>
1299<p>
1300 Pathspec is passed in <code>&lt;file&gt;</code> instead of commandline args. If
1301 <code>&lt;file&gt;</code> is exactly <code>-</code> then standard input is used. Pathspec
1302 elements are separated by LF or CR/LF. Pathspec elements can be
1303 quoted as explained for the configuration variable <code>core.quotePath</code>
1304 (see <a href="git-config.html">git-config(1)</a>). See also <code>--pathspec-file-nul</code> and
1305 global <code>--literal-pathspecs</code>.
1306</p>
1307</dd>
1308<dt class="hdlist1">
1309--pathspec-file-nul
1310</dt>
1311<dd>
1312<p>
1313 Only meaningful with <code>--pathspec-from-file</code>. Pathspec elements are
1314 separated with NUL character and all other characters are taken
1315 literally (including newlines and quotes).
1316</p>
1317</dd>
1318<dt class="hdlist1">
Junio C Hamano4224f992008-06-23 07:14:081319-u[&lt;mode&gt;]
Junio C Hamanoeb415992008-06-08 22:49:471320</dt>
Junio C Hamano60186642010-12-02 14:18:261321<dt class="hdlist1">
Junio C Hamano4224f992008-06-23 07:14:081322--untracked-files[=&lt;mode&gt;]
Junio C Hamano1e6e0062007-07-13 05:33:251323</dt>
1324<dd>
1325<p>
Junio C Hamano36a4dbc2011-02-22 07:51:321326 Show untracked files.
Junio C Hamano1e6e0062007-07-13 05:33:251327</p>
Junio C Hamano48cd3f12019-10-09 05:55:301328<div class="openblock">
1329<div class="content">
Junio C Hamano36a4dbc2011-02-22 07:51:321330<div class="paragraph"><p>The mode parameter is optional (defaults to <em>all</em>), and is used to
1331specify the handling of untracked files; when -u is not used, the
1332default is <em>normal</em>, i.e. show untracked files and directories.</p></div>
Junio C Hamano60186642010-12-02 14:18:261333<div class="paragraph"><p>The possible options are:</p></div>
1334<div class="ulist"><ul>
Junio C Hamano4224f992008-06-23 07:14:081335<li>
1336<p>
1337<em>no</em> - Show no untracked files
1338</p>
1339</li>
1340<li>
1341<p>
1342<em>normal</em> - Shows untracked files and directories
1343</p>
1344</li>
1345<li>
1346<p>
1347<em>all</em> - Also shows individual files in untracked directories.
1348</p>
Junio C Hamanoe1cca182010-02-20 20:01:231349</li>
1350</ul></div>
Junio C Hamano48cd3f12019-10-09 05:55:301351<div class="paragraph"><p>The default can be changed using the status.showUntrackedFiles
1352configuration variable documented in <a href="git-config.html">git-config(1)</a>.</p></div>
1353</div></div>
Junio C Hamano1e6e0062007-07-13 05:33:251354</dd>
Junio C Hamano60186642010-12-02 14:18:261355<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471356-v
1357</dt>
Junio C Hamano60186642010-12-02 14:18:261358<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471359--verbose
Junio C Hamano1e6e0062007-07-13 05:33:251360</dt>
1361<dd>
1362<p>
1363 Show unified diff between the HEAD commit and what
1364 would be committed at the bottom of the commit message
Junio C Hamanoe1b28592015-05-19 21:26:171365 template to help the user describe the commit by reminding
1366 what changes the commit has.
1367 Note that this diff output doesn&#8217;t have its
1368 lines prefixed with <em>#</em>. This diff will not be a part
Junio C Hamanof2a3a752016-05-23 22:54:391369 of the commit message. See the <code>commit.verbose</code> configuration
1370 variable in <a href="git-config.html">git-config(1)</a>.
Junio C Hamano1e6e0062007-07-13 05:33:251371</p>
Junio C Hamano5992a252015-03-17 23:39:301372<div class="paragraph"><p>If specified twice, show in addition the unified diff between
1373what would be committed and the worktree files, i.e. the unstaged
1374changes to tracked files.</p></div>
Junio C Hamano1e6e0062007-07-13 05:33:251375</dd>
Junio C Hamano60186642010-12-02 14:18:261376<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471377-q
1378</dt>
Junio C Hamano60186642010-12-02 14:18:261379<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471380--quiet
Junio C Hamano7d23f5e2006-12-16 07:44:041381</dt>
1382<dd>
1383<p>
Junio C Hamanof9771f62007-01-17 17:42:301384 Suppress commit summary message.
Junio C Hamano7d23f5e2006-12-16 07:44:041385</p>
1386</dd>
Junio C Hamano60186642010-12-02 14:18:261387<dt class="hdlist1">
Junio C Hamano1bb31992009-08-29 04:24:081388--dry-run
1389</dt>
1390<dd>
1391<p>
1392 Do not create a commit, but show a list of paths that are
1393 to be committed, paths with local changes that will be left
1394 uncommitted and paths that are untracked.
1395</p>
1396</dd>
Junio C Hamano60186642010-12-02 14:18:261397<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:501398--status
1399</dt>
1400<dd>
1401<p>
Junio C Hamanoa28a9202012-06-21 07:08:231402 Include the output of <a href="git-status.html">git-status(1)</a> in the commit
Junio C Hamano6ce6b6c2010-01-18 01:25:501403 message template when using an editor to prepare the commit
1404 message. Defaults to on, but can be used to override
1405 configuration variable commit.status.
1406</p>
1407</dd>
Junio C Hamano60186642010-12-02 14:18:261408<dt class="hdlist1">
Junio C Hamano6ce6b6c2010-01-18 01:25:501409--no-status
1410</dt>
1411<dd>
1412<p>
Junio C Hamanoa28a9202012-06-21 07:08:231413 Do not include the output of <a href="git-status.html">git-status(1)</a> in the
Junio C Hamano6ce6b6c2010-01-18 01:25:501414 commit message template when using an editor to prepare the
1415 default commit message.
1416</p>
1417</dd>
Junio C Hamano60186642010-12-02 14:18:261418<dt class="hdlist1">
Junio C Hamanoa1295452012-11-13 22:32:041419-S[&lt;keyid&gt;]
1420</dt>
1421<dt class="hdlist1">
1422--gpg-sign[=&lt;keyid&gt;]
1423</dt>
Junio C Hamanoa1295452012-11-13 22:32:041424<dt class="hdlist1">
Junio C Hamano5b3533d2014-02-27 23:07:151425--no-gpg-sign
1426</dt>
1427<dd>
1428<p>
Junio C Hamano67bf2242020-04-22 21:41:441429 GPG-sign commits. The <code>keyid</code> argument is optional and
1430 defaults to the committer identity; if specified, it must be
1431 stuck to the option without a space. <code>--no-gpg-sign</code> is useful to
1432 countermand both <code>commit.gpgSign</code> configuration variable, and
1433 earlier <code>--gpg-sign</code>.
Junio C Hamano5b3533d2014-02-27 23:07:151434</p>
1435</dd>
1436<dt class="hdlist1">
Junio C Hamano1bb569e2006-05-05 23:14:251437--
Junio C Hamano1a4e8412005-12-27 08:17:231438</dt>
1439<dd>
1440<p>
1441 Do not interpret any more arguments as options.
1442</p>
1443</dd>
Junio C Hamano60186642010-12-02 14:18:261444<dt class="hdlist1">
Junio C Hamanob4896852019-12-10 23:15:091445&lt;pathspec&gt;&#8230;
Junio C Hamano1a4e8412005-12-27 08:17:231446</dt>
1447<dd>
1448<p>
Junio C Hamanob4896852019-12-10 23:15:091449 When pathspec is given on the command line, commit the contents of
1450 the files that match the pathspec without recording the changes
1451 already added to the index. The contents of these files are also
1452 staged for the next commit on top of what have been staged before.
Junio C Hamano1a4e8412005-12-27 08:17:231453</p>
Junio C Hamanob4896852019-12-10 23:15:091454<div class="paragraph"><p>For more details, see the <em>pathspec</em> entry in <a href="gitglossary.html">gitglossary(7)</a>.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231455</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311456</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231457</div>
Junio C Hamano9d971152012-12-19 00:43:111458</div>
1459<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311460<h2 id="_examples">EXAMPLES</h2>
Junio C Hamano40f2f8d2006-02-07 08:04:391461<div class="sectionbody">
Junio C Hamano60186642010-12-02 14:18:261462<div class="paragraph"><p>When recording your own work, the contents of modified files in
Junio C Hamanoe7935c42006-12-13 21:32:171463your working tree are temporarily stored to a staging area
Junio C Hamano1aa40d22010-01-21 17:46:431464called the "index" with <em>git add</em>. A file can be
Junio C Hamano361c1332007-11-14 12:17:221465reverted back, only in the index but not in the working tree,
Junio C Hamanoc9f11c22019-07-10 02:54:041466to that of the last commit with <code>git restore --staged &lt;file&gt;</code>,
Junio C Hamano1aa40d22010-01-21 17:46:431467which effectively reverts <em>git add</em> and prevents the changes to
Junio C Hamano361c1332007-11-14 12:17:221468this file from participating in the next commit. After building
1469the state to be committed incrementally with these commands,
Junio C Hamanoc14e6ad2014-10-31 20:25:531470<code>git commit</code> (without any pathname parameter) is used to record what
Junio C Hamanoe7935c42006-12-13 21:32:171471has been staged so far. This is the most basic form of the
Junio C Hamanoba4b9282008-07-06 05:20:311472command. An example:</p></div>
Junio C Hamanoe7935c42006-12-13 21:32:171473<div class="listingblock">
Junio C Hamano40f2f8d2006-02-07 08:04:391474<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531475<pre><code>$ edit hello.c
Junio C Hamanoe7935c42006-12-13 21:32:171476$ git rm goodbye.c
1477$ git add hello.c
Junio C Hamanoc14e6ad2014-10-31 20:25:531478$ git commit</code></pre>
Junio C Hamano40f2f8d2006-02-07 08:04:391479</div></div>
Junio C Hamano60186642010-12-02 14:18:261480<div class="paragraph"><p>Instead of staging files after each individual change, you can
Junio C Hamanoc14e6ad2014-10-31 20:25:531481tell <code>git commit</code> to notice the changes to the files whose
Junio C Hamanoe7935c42006-12-13 21:32:171482contents are tracked in
Junio C Hamanoc14e6ad2014-10-31 20:25:531483your working tree and do corresponding <code>git add</code> and <code>git rm</code>
Junio C Hamanoe7935c42006-12-13 21:32:171484for you. That is, this example does the same as the earlier
Junio C Hamanoba4b9282008-07-06 05:20:311485example if there is no other change in your working tree:</p></div>
Junio C Hamanoe7935c42006-12-13 21:32:171486<div class="listingblock">
1487<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531488<pre><code>$ edit hello.c
Junio C Hamanoe7935c42006-12-13 21:32:171489$ rm goodbye.c
Junio C Hamanoc14e6ad2014-10-31 20:25:531490$ git commit -a</code></pre>
Junio C Hamanoe7935c42006-12-13 21:32:171491</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531492<div class="paragraph"><p>The command <code>git commit -a</code> first looks at your working tree,
Junio C Hamanoe7935c42006-12-13 21:32:171493notices that you have modified hello.c and removed goodbye.c,
Junio C Hamanoc14e6ad2014-10-31 20:25:531494and performs necessary <code>git add</code> and <code>git rm</code> for you.</p></div>
Junio C Hamano60186642010-12-02 14:18:261495<div class="paragraph"><p>After staging changes to many files, you can alter the order the
Junio C Hamanoc14e6ad2014-10-31 20:25:531496changes are recorded in, by giving pathnames to <code>git commit</code>.
Junio C Hamanoe7935c42006-12-13 21:32:171497When pathnames are given, the command makes a commit that
Junio C Hamanoba4b9282008-07-06 05:20:311498only records the changes made to the named paths:</p></div>
Junio C Hamanoe7935c42006-12-13 21:32:171499<div class="listingblock">
1500<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531501<pre><code>$ edit hello.c hello.h
Junio C Hamanoe7935c42006-12-13 21:32:171502$ git add hello.c hello.h
1503$ edit Makefile
Junio C Hamanoc14e6ad2014-10-31 20:25:531504$ git commit Makefile</code></pre>
Junio C Hamanoe7935c42006-12-13 21:32:171505</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531506<div class="paragraph"><p>This makes a commit that records the modification to <code>Makefile</code>.
1507The changes staged for <code>hello.c</code> and <code>hello.h</code> are not included
Junio C Hamano60186642010-12-02 14:18:261508in the resulting commit. However, their changes are not lost&#8201;&#8212;&#8201;they are still staged and merely held back. After the above
Junio C Hamanoba4b9282008-07-06 05:20:311509sequence, if you do:</p></div>
Junio C Hamanoe7935c42006-12-13 21:32:171510<div class="listingblock">
1511<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531512<pre><code>$ git commit</code></pre>
Junio C Hamanoe7935c42006-12-13 21:32:171513</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531514<div class="paragraph"><p>this second commit would record the changes to <code>hello.c</code> and
1515<code>hello.h</code> as expected.</p></div>
Junio C Hamano60186642010-12-02 14:18:261516<div class="paragraph"><p>After a merge (initiated by <em>git merge</em> or <em>git pull</em>) stops
Junio C Hamanofce7c7e2008-07-02 03:06:381517because of conflicts, cleanly merged
Junio C Hamanoe7935c42006-12-13 21:32:171518paths are already staged to be committed for you, and paths that
1519conflicted are left in unmerged state. You would have to first
Junio C Hamano1aa40d22010-01-21 17:46:431520check which paths are conflicting with <em>git status</em>
Junio C Hamanoe7935c42006-12-13 21:32:171521and after fixing them manually in your working tree, you would
Junio C Hamano1aa40d22010-01-21 17:46:431522stage the result as usual with <em>git add</em>:</p></div>
Junio C Hamanoe7935c42006-12-13 21:32:171523<div class="listingblock">
1524<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531525<pre><code>$ git status | grep unmerged
Junio C Hamanoe7935c42006-12-13 21:32:171526unmerged: hello.c
1527$ edit hello.c
Junio C Hamanoc14e6ad2014-10-31 20:25:531528$ git add hello.c</code></pre>
Junio C Hamanoe7935c42006-12-13 21:32:171529</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531530<div class="paragraph"><p>After resolving conflicts and staging the result, <code>git ls-files -u</code>
Junio C Hamanoe7935c42006-12-13 21:32:171531would stop mentioning the conflicted path. When you are done,
Junio C Hamanoc14e6ad2014-10-31 20:25:531532run <code>git commit</code> to finally record the merge:</p></div>
Junio C Hamanoe7935c42006-12-13 21:32:171533<div class="listingblock">
1534<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531535<pre><code>$ git commit</code></pre>
Junio C Hamanoe7935c42006-12-13 21:32:171536</div></div>
Junio C Hamanoc14e6ad2014-10-31 20:25:531537<div class="paragraph"><p>As with the case to record your own changes, you can use <code>-a</code>
Junio C Hamanoe7935c42006-12-13 21:32:171538option to save typing. One difference is that during a merge
Junio C Hamanoc14e6ad2014-10-31 20:25:531539resolution, you cannot use <code>git commit</code> with pathnames to
Junio C Hamanoe7935c42006-12-13 21:32:171540alter the order the changes are committed, because the merge
1541should be recorded as a single commit. In fact, the command
Junio C Hamanoc14e6ad2014-10-31 20:25:531542refuses to run when given pathnames (but see <code>-i</code> option).</p></div>
Junio C Hamanoe7935c42006-12-13 21:32:171543</div>
Junio C Hamano9d971152012-12-19 00:43:111544</div>
1545<div class="sect1">
Junio C Hamanobee061d2020-01-30 23:21:181546<h2 id="_commit_information">COMMIT INFORMATION</h2>
1547<div class="sectionbody">
1548<div class="paragraph"><p>Author and committer information is taken from the following environment
1549variables, if set:</p></div>
1550<div class="literalblock">
1551<div class="content">
1552<pre><code>GIT_AUTHOR_NAME
1553GIT_AUTHOR_EMAIL
1554GIT_AUTHOR_DATE
1555GIT_COMMITTER_NAME
1556GIT_COMMITTER_EMAIL
1557GIT_COMMITTER_DATE</code></pre>
1558</div></div>
1559<div class="paragraph"><p>(nb "&lt;", "&gt;" and "\n"s are stripped)</p></div>
1560<div class="paragraph"><p>The author and committer names are by convention some form of a personal name
1561(that is, the name by which other humans refer to you), although Git does not
1562enforce or require any particular form. Arbitrary Unicode may be used, subject
1563to the constraints listed above. This name has no effect on authentication; for
1564that, see the <code>credential.username</code> variable in <a href="git-config.html">git-config(1)</a>.</p></div>
1565<div class="paragraph"><p>In case (some of) these environment variables are not set, the information
1566is taken from the configuration items <code>user.name</code> and <code>user.email</code>, or, if not
1567present, the environment variable EMAIL, or, if that is not set,
1568system user name and the hostname used for outgoing mail (taken
1569from <code>/etc/mailname</code> and falling back to the fully qualified hostname when
1570that file does not exist).</p></div>
1571<div class="paragraph"><p>The <code>author.name</code> and <code>committer.name</code> and their corresponding email options
1572override <code>user.name</code> and <code>user.email</code> if set and are overridden themselves by
1573the environment variables.</p></div>
1574<div class="paragraph"><p>The typical usage is to set just the <code>user.name</code> and <code>user.email</code> variables;
1575the other options are provided for more complex use cases.</p></div>
1576</div>
1577</div>
1578<div class="sect1">
1579<h2 id="_date_formats">DATE FORMATS</h2>
1580<div class="sectionbody">
Junio C Hamanoa372d5b2021-02-26 01:34:371581<div class="paragraph"><p>The <code>GIT_AUTHOR_DATE</code> and <code>GIT_COMMITTER_DATE</code> environment variables
Junio C Hamanobee061d2020-01-30 23:21:181582support the following date formats:</p></div>
1583<div class="dlist"><dl>
1584<dt class="hdlist1">
1585Git internal format
1586</dt>
1587<dd>
1588<p>
Junio C Hamano59a32b02021-12-10 22:53:381589 It is <code>&lt;unix-timestamp&gt; &lt;time-zone-offset&gt;</code>, where
1590 <code>&lt;unix-timestamp&gt;</code> is the number of seconds since the UNIX epoch.
1591 <code>&lt;time-zone-offset&gt;</code> is a positive or negative offset from UTC.
Junio C Hamanobee061d2020-01-30 23:21:181592 For example CET (which is 1 hour ahead of UTC) is <code>+0100</code>.
1593</p>
1594</dd>
1595<dt class="hdlist1">
1596RFC 2822
1597</dt>
1598<dd>
1599<p>
1600 The standard email format as described by RFC 2822, for example
1601 <code>Thu, 07 Apr 2005 22:13:13 +0200</code>.
1602</p>
1603</dd>
1604<dt class="hdlist1">
1605ISO 8601
1606</dt>
1607<dd>
1608<p>
1609 Time and date specified by the ISO 8601 standard, for example
1610 <code>2005-04-07T22:13:13</code>. The parser accepts a space instead of the
Junio C Hamanodd4c1782020-05-05 22:34:541611 <code>T</code> character as well. Fractional parts of a second will be ignored,
1612 for example <code>2005-04-07T22:13:13.019</code> will be treated as
Junio C Hamano0beab6c2020-05-26 18:32:251613 <code>2005-04-07T22:13:13</code>.
Junio C Hamanobee061d2020-01-30 23:21:181614</p>
Junio C Hamano0beab6c2020-05-26 18:32:251615<div class="admonitionblock">
1616<table><tr>
1617<td class="icon">
1618<div class="title">Note</div>
1619</td>
1620<td class="content">In addition, the date part is accepted in the following formats:
1621<code>YYYY.MM.DD</code>, <code>MM/DD/YYYY</code> and <code>DD.MM.YYYY</code>.</td>
1622</tr></table>
1623</div>
Junio C Hamanobee061d2020-01-30 23:21:181624</dd>
1625</dl></div>
Junio C Hamanoa372d5b2021-02-26 01:34:371626<div class="paragraph"><p>In addition to recognizing all date formats above, the <code>--date</code> option
1627will also try to make sense of other, more human-centric date formats,
1628such as relative dates like "yesterday" or "last Friday at noon".</p></div>
Junio C Hamanobee061d2020-01-30 23:21:181629</div>
1630</div>
1631<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311632<h2 id="_discussion">DISCUSSION</h2>
Junio C Hamano775a0f42006-12-31 01:19:141633<div class="sectionbody">
Junio C Hamano60186642010-12-02 14:18:261634<div class="paragraph"><p>Though not required, it&#8217;s a good idea to begin the commit message
Junio C Hamano8f76dc62007-01-17 07:24:251635with a single short (less than 50 character) line summarizing the
1636change, followed by a blank line and then a more thorough description.
Junio C Hamano281fd392012-09-17 23:57:411637The text up to the first blank line in a commit message is treated
Junio C Hamano076ffcc2013-02-06 05:13:211638as the commit title, and that title is used throughout Git.
Junio C Hamano281fd392012-09-17 23:57:411639For example, <a href="git-format-patch.html">git-format-patch(1)</a> turns a commit into email, and it uses
1640the title on the Subject line and the rest of the commit in the body.</p></div>
Junio C Hamanod7ed4042015-08-03 19:43:001641<div class="paragraph"><p>Git is to some extent character encoding agnostic.</p></div>
Junio C Hamano60186642010-12-02 14:18:261642<div class="ulist"><ul>
Junio C Hamano775a0f42006-12-31 01:19:141643<li>
1644<p>
Junio C Hamano54bf1e22008-12-20 06:30:111645The contents of the blob objects are uninterpreted sequences
Junio C Hamano775a0f42006-12-31 01:19:141646 of bytes. There is no encoding translation at the core
1647 level.
1648</p>
1649</li>
1650<li>
1651<p>
Junio C Hamanod7ed4042015-08-03 19:43:001652Path names are encoded in UTF-8 normalization form C. This
1653 applies to tree objects, the index file, ref names, as well as
1654 path names in command line arguments, environment variables
1655 and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>),
1656 <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and
1657 <a href="gitmodules.html">gitmodules(5)</a>).
1658</p>
1659<div class="paragraph"><p>Note that Git at the core level treats path names simply as
1660sequences of non-NUL bytes, there are no path name encoding
1661conversions (except on Mac and Windows). Therefore, using
1662non-ASCII path names will mostly work even on platforms and file
1663systems that use legacy extended ASCII encodings. However,
1664repositories created on such systems will not work properly on
1665UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa.
1666Additionally, many Git-based tools simply assume path names to
1667be UTF-8 and will fail to display other encodings correctly.</p></div>
1668</li>
1669<li>
1670<p>
1671Commit log messages are typically encoded in UTF-8, but other
1672 extended ASCII encodings are also supported. This includes
1673 ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32,
1674 EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5,
1675 EUC-x, CP9xx etc.).
Junio C Hamano775a0f42006-12-31 01:19:141676</p>
1677</li>
Junio C Hamanoba4b9282008-07-06 05:20:311678</ul></div>
Junio C Hamano60186642010-12-02 14:18:261679<div class="paragraph"><p>Although we encourage that the commit log messages are encoded
Junio C Hamano076ffcc2013-02-06 05:13:211680in UTF-8, both the core and Git Porcelain are designed not to
Junio C Hamano775a0f42006-12-31 01:19:141681force UTF-8 on projects. If all participants of a particular
Junio C Hamano076ffcc2013-02-06 05:13:211682project find it more convenient to use legacy encodings, Git
Junio C Hamano775a0f42006-12-31 01:19:141683does not forbid it. However, there are a few things to keep in
Junio C Hamanoba4b9282008-07-06 05:20:311684mind.</p></div>
Junio C Hamano60186642010-12-02 14:18:261685<div class="olist arabic"><ol class="arabic">
Junio C Hamano775a0f42006-12-31 01:19:141686<li>
1687<p>
Junio C Hamano1aa40d22010-01-21 17:46:431688<em>git commit</em> and <em>git commit-tree</em> issues
Junio C Hamano14b76482008-01-05 10:32:261689 a warning if the commit log message given to it does not look
Junio C Hamano775a0f42006-12-31 01:19:141690 like a valid UTF-8 string, unless you explicitly say your
1691 project uses a legacy encoding. The way to say this is to
Junio C Hamanoa372d5b2021-02-26 01:34:371692 have <code>i18n.commitEncoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:141693</p>
1694<div class="listingblock">
1695<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531696<pre><code>[i18n]
Junio C Hamanobb34c102017-07-21 22:42:281697 commitEncoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:141698</div></div>
Junio C Hamano60186642010-12-02 14:18:261699<div class="paragraph"><p>Commit objects created with the above setting record the value
Junio C Hamanobb34c102017-07-21 22:42:281700of <code>i18n.commitEncoding</code> in its <code>encoding</code> header. This is to
Junio C Hamano775a0f42006-12-31 01:19:141701help other people who look at them later. Lack of this header
Junio C Hamanoba4b9282008-07-06 05:20:311702implies that the commit log message is encoded in UTF-8.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:141703</li>
1704<li>
1705<p>
Junio C Hamano1aa40d22010-01-21 17:46:431706<em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the
Junio C Hamanoc14e6ad2014-10-31 20:25:531707 <code>encoding</code> header of a commit object, and try to re-code the
Junio C Hamanoaa17c7c2008-11-03 04:36:581708 log message into UTF-8 unless otherwise specified. You can
Junio C Hamano775a0f42006-12-31 01:19:141709 specify the desired output encoding with
Junio C Hamanobb34c102017-07-21 22:42:281710 <code>i18n.logOutputEncoding</code> in <code>.git/config</code> file, like this:
Junio C Hamano775a0f42006-12-31 01:19:141711</p>
1712<div class="listingblock">
1713<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531714<pre><code>[i18n]
Junio C Hamanobb34c102017-07-21 22:42:281715 logOutputEncoding = ISO-8859-1</code></pre>
Junio C Hamano775a0f42006-12-31 01:19:141716</div></div>
Junio C Hamano60186642010-12-02 14:18:261717<div class="paragraph"><p>If you do not have this configuration variable, the value of
Junio C Hamanobb34c102017-07-21 22:42:281718<code>i18n.commitEncoding</code> is used instead.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:141719</li>
Junio C Hamanoba4b9282008-07-06 05:20:311720</ol></div>
Junio C Hamano60186642010-12-02 14:18:261721<div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log
Junio C Hamano775a0f42006-12-31 01:19:141722message when a commit is made to force UTF-8 at the commit
1723object level, because re-coding to UTF-8 is not necessarily a
Junio C Hamanoba4b9282008-07-06 05:20:311724reversible operation.</p></div>
Junio C Hamano775a0f42006-12-31 01:19:141725</div>
Junio C Hamano9d971152012-12-19 00:43:111726</div>
1727<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311728<h2 id="_environment_and_configuration_variables">ENVIRONMENT AND CONFIGURATION VARIABLES</h2>
Junio C Hamanoe7935c42006-12-13 21:32:171729<div class="sectionbody">
Junio C Hamano60186642010-12-02 14:18:261730<div class="paragraph"><p>The editor used to edit the commit log message will be chosen from the
Junio C Hamano042f2142016-06-27 18:05:051731<code>GIT_EDITOR</code> environment variable, the core.editor configuration variable, the
1732<code>VISUAL</code> environment variable, or the <code>EDITOR</code> environment variable (in that
Junio C Hamanoa28a9202012-06-21 07:08:231733order). See <a href="git-var.html">git-var(1)</a> for details.</p></div>
Junio C Hamanoe7935c42006-12-13 21:32:171734</div>
Junio C Hamano9d971152012-12-19 00:43:111735</div>
1736<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311737<h2 id="_hooks">HOOKS</h2>
Junio C Hamanoe7935c42006-12-13 21:32:171738<div class="sectionbody">
Junio C Hamanoc14e6ad2014-10-31 20:25:531739<div class="paragraph"><p>This command can run <code>commit-msg</code>, <code>prepare-commit-msg</code>, <code>pre-commit</code>,
Junio C Hamanocb06ef92017-03-21 22:40:141740<code>post-commit</code> and <code>post-rewrite</code> hooks. See <a href="githooks.html">githooks(5)</a> for more
Junio C Hamanoba4b9282008-07-06 05:20:311741information.</p></div>
Junio C Hamanoe7935c42006-12-13 21:32:171742</div>
Junio C Hamano9d971152012-12-19 00:43:111743</div>
1744<div class="sect1">
Junio C Hamano28a85be2012-07-24 22:05:151745<h2 id="_files">FILES</h2>
1746<div class="sectionbody">
1747<div class="dlist"><dl>
1748<dt class="hdlist1">
Junio C Hamanoc14e6ad2014-10-31 20:25:531749<code>$GIT_DIR/COMMIT_EDITMSG</code>
Junio C Hamano28a85be2012-07-24 22:05:151750</dt>
1751<dd>
1752<p>
1753 This file contains the commit message of a commit in progress.
Junio C Hamanoc14e6ad2014-10-31 20:25:531754 If <code>git commit</code> exits due to an error before creating a commit,
Junio C Hamano28a85be2012-07-24 22:05:151755 any commit message that has been provided by the user (e.g., in
1756 an editor session) will be available in this file, but will be
Junio C Hamanoc14e6ad2014-10-31 20:25:531757 overwritten by the next invocation of <code>git commit</code>.
Junio C Hamano28a85be2012-07-24 22:05:151758</p>
1759</dd>
1760</dl></div>
1761</div>
Junio C Hamano9d971152012-12-19 00:43:111762</div>
1763<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311764<h2 id="_see_also">SEE ALSO</h2>
Junio C Hamanoe7935c42006-12-13 21:32:171765<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231766<div class="paragraph"><p><a href="git-add.html">git-add(1)</a>,
1767<a href="git-rm.html">git-rm(1)</a>,
1768<a href="git-mv.html">git-mv(1)</a>,
1769<a href="git-merge.html">git-merge(1)</a>,
1770<a href="git-commit-tree.html">git-commit-tree(1)</a></p></div>
Junio C Hamano40f2f8d2006-02-07 08:04:391771</div>
Junio C Hamano9d971152012-12-19 00:43:111772</div>
1773<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311774<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231775<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231776<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231777</div>
Junio C Hamano7bd050f2011-09-22 06:32:221778</div>
Junio C Hamano9d971152012-12-19 00:43:111779</div>
Junio C Hamano7bd050f2011-09-22 06:32:221780<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231781<div id="footer">
1782<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:531783Last updated
Junio C Hamano14390e22022-03-17 01:11:121784 2021-11-04 13:20:34 PDT
Junio C Hamano1a4e8412005-12-27 08:17:231785</div>
1786</div>
1787</body>
1788</html>