Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.5.2" /> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 7 | <title>git-commit(1)</title> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 8 | <style type="text/css"> |
| 9 | /* Debug borders */ |
| 10 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 11 | /* |
| 12 | border: 1px solid red; |
| 13 | */ |
| 14 | } |
| 15 | |
| 16 | body { |
| 17 | margin: 1em 5% 1em 5%; |
| 18 | } |
| 19 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 20 | a { |
| 21 | color: blue; |
| 22 | text-decoration: underline; |
| 23 | } |
| 24 | a:visited { |
| 25 | color: fuchsia; |
| 26 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 27 | |
| 28 | em { |
| 29 | font-style: italic; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 30 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | strong { |
| 34 | font-weight: bold; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 35 | color: #083194; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | tt { |
| 39 | color: navy; |
| 40 | } |
| 41 | |
| 42 | h1, h2, h3, h4, h5, h6 { |
| 43 | color: #527bbd; |
| 44 | font-family: sans-serif; |
| 45 | margin-top: 1.2em; |
| 46 | margin-bottom: 0.5em; |
| 47 | line-height: 1.3; |
| 48 | } |
| 49 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 50 | h1, h2, h3 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 51 | border-bottom: 2px solid silver; |
| 52 | } |
| 53 | h2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 54 | padding-top: 0.5em; |
| 55 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 56 | h3 { |
| 57 | float: left; |
| 58 | } |
| 59 | h3 + * { |
| 60 | clear: left; |
| 61 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 62 | |
| 63 | div.sectionbody { |
| 64 | font-family: serif; |
| 65 | margin-left: 0; |
| 66 | } |
| 67 | |
| 68 | hr { |
| 69 | border: 1px solid silver; |
| 70 | } |
| 71 | |
| 72 | p { |
| 73 | margin-top: 0.5em; |
| 74 | margin-bottom: 0.5em; |
| 75 | } |
| 76 | |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 77 | ul, ol, li > p { |
| 78 | margin-top: 0; |
| 79 | } |
| 80 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 81 | pre { |
| 82 | padding: 0; |
| 83 | margin: 0; |
| 84 | } |
| 85 | |
| 86 | span#author { |
| 87 | color: #527bbd; |
| 88 | font-family: sans-serif; |
| 89 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 90 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 91 | } |
| 92 | span#email { |
| 93 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 94 | span#revnumber, span#revdate, span#revremark { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 95 | font-family: sans-serif; |
| 96 | } |
| 97 | |
| 98 | div#footer { |
| 99 | font-family: sans-serif; |
| 100 | font-size: small; |
| 101 | border-top: 2px solid silver; |
| 102 | padding-top: 0.5em; |
| 103 | margin-top: 4.0em; |
| 104 | } |
| 105 | div#footer-text { |
| 106 | float: left; |
| 107 | padding-bottom: 0.5em; |
| 108 | } |
| 109 | div#footer-badges { |
| 110 | float: right; |
| 111 | padding-bottom: 0.5em; |
| 112 | } |
| 113 | |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 114 | div#preamble { |
| 115 | margin-top: 1.5em; |
| 116 | margin-bottom: 1.5em; |
| 117 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 118 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 119 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 120 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 121 | margin-top: 1.0em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 122 | margin-bottom: 1.5em; |
| 123 | } |
| 124 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 125 | margin-top: 2.0em; |
| 126 | margin-bottom: 2.0em; |
| 127 | margin-right: 10%; |
| 128 | color: #606060; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | div.content { /* Block element content. */ |
| 132 | padding: 0; |
| 133 | } |
| 134 | |
| 135 | /* Block element titles. */ |
| 136 | div.title, caption.title { |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 137 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 138 | font-family: sans-serif; |
| 139 | font-weight: bold; |
| 140 | text-align: left; |
| 141 | margin-top: 1.0em; |
| 142 | margin-bottom: 0.5em; |
| 143 | } |
| 144 | div.title + * { |
| 145 | margin-top: 0; |
| 146 | } |
| 147 | |
| 148 | td div.title:first-child { |
| 149 | margin-top: 0.0em; |
| 150 | } |
| 151 | div.content div.title:first-child { |
| 152 | margin-top: 0.0em; |
| 153 | } |
| 154 | div.content + div.title { |
| 155 | margin-top: 0.0em; |
| 156 | } |
| 157 | |
| 158 | div.sidebarblock > div.content { |
| 159 | background: #ffffee; |
| 160 | border: 1px solid silver; |
| 161 | padding: 0.5em; |
| 162 | } |
| 163 | |
| 164 | div.listingblock > div.content { |
| 165 | border: 1px solid silver; |
| 166 | background: #f4f4f4; |
| 167 | padding: 0.5em; |
| 168 | } |
| 169 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 170 | div.quoteblock, div.verseblock { |
| 171 | padding-left: 1.0em; |
| 172 | margin-left: 1.0em; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 173 | margin-right: 10%; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 174 | border-left: 5px solid #dddddd; |
| 175 | color: #777777; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 176 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 177 | |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 178 | div.quoteblock > div.attribution { |
| 179 | padding-top: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 180 | text-align: right; |
| 181 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 182 | |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 183 | div.verseblock > div.content { |
| 184 | white-space: pre; |
| 185 | } |
| 186 | div.verseblock > div.attribution { |
| 187 | padding-top: 0.75em; |
| 188 | text-align: left; |
| 189 | } |
| 190 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 191 | div.verseblock + div.attribution { |
| 192 | text-align: left; |
| 193 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 194 | |
| 195 | div.admonitionblock .icon { |
| 196 | vertical-align: top; |
| 197 | font-size: 1.1em; |
| 198 | font-weight: bold; |
| 199 | text-decoration: underline; |
| 200 | color: #527bbd; |
| 201 | padding-right: 0.5em; |
| 202 | } |
| 203 | div.admonitionblock td.content { |
| 204 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 205 | border-left: 3px solid #dddddd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 209 | border-left: 3px solid #dddddd; |
| 210 | padding-left: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 211 | } |
| 212 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 213 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 214 | span.image img { border-style: none; } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 215 | a.image:visited { color: white; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 216 | |
| 217 | dl { |
| 218 | margin-top: 0.8em; |
| 219 | margin-bottom: 0.8em; |
| 220 | } |
| 221 | dt { |
| 222 | margin-top: 0.5em; |
| 223 | margin-bottom: 0; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 224 | font-style: normal; |
| 225 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 226 | } |
| 227 | dd > *:first-child { |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 228 | margin-top: 0.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | ul, ol { |
| 232 | list-style-position: outside; |
| 233 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 234 | ol.arabic { |
| 235 | list-style-type: decimal; |
| 236 | } |
| 237 | ol.loweralpha { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 238 | list-style-type: lower-alpha; |
| 239 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 240 | ol.upperalpha { |
| 241 | list-style-type: upper-alpha; |
| 242 | } |
| 243 | ol.lowerroman { |
| 244 | list-style-type: lower-roman; |
| 245 | } |
| 246 | ol.upperroman { |
| 247 | list-style-type: upper-roman; |
| 248 | } |
| 249 | |
| 250 | div.compact ul, div.compact ol, |
| 251 | div.compact p, div.compact p, |
| 252 | div.compact div, div.compact div { |
| 253 | margin-top: 0.1em; |
| 254 | margin-bottom: 0.1em; |
| 255 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 256 | |
| 257 | div.tableblock > table { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 258 | border: 3px solid #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 259 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 260 | thead, p.table.header { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 261 | font-family: sans-serif; |
| 262 | font-weight: bold; |
| 263 | } |
| 264 | tfoot { |
| 265 | font-weight: bold; |
| 266 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 267 | td > div.verse { |
| 268 | white-space: pre; |
| 269 | } |
| 270 | p.table { |
| 271 | margin-top: 0; |
| 272 | } |
| 273 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 274 | div.tableblock > table[frame="void"] { |
| 275 | border-style: none; |
| 276 | } |
| 277 | div.tableblock > table[frame="hsides"] { |
| 278 | border-left-style: none; |
| 279 | border-right-style: none; |
| 280 | } |
| 281 | div.tableblock > table[frame="vsides"] { |
| 282 | border-top-style: none; |
| 283 | border-bottom-style: none; |
| 284 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 285 | |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 286 | |
| 287 | div.hdlist { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 288 | margin-top: 0.8em; |
| 289 | margin-bottom: 0.8em; |
| 290 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 291 | div.hdlist tr { |
| 292 | padding-bottom: 15px; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 293 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 294 | dt.hdlist1.strong, td.hdlist1.strong { |
| 295 | font-weight: bold; |
| 296 | } |
| 297 | td.hdlist1 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 298 | vertical-align: top; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 299 | font-style: normal; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 300 | padding-right: 0.8em; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 301 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 302 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 303 | td.hdlist2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 304 | vertical-align: top; |
| 305 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 306 | div.hdlist.compact tr { |
| 307 | margin: 0; |
| 308 | padding-bottom: 0; |
| 309 | } |
| 310 | |
| 311 | .comment { |
| 312 | background: yellow; |
| 313 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 314 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 315 | .footnote, .footnoteref { |
| 316 | font-size: 0.8em; |
| 317 | } |
| 318 | |
| 319 | span.footnote, span.footnoteref { |
| 320 | vertical-align: super; |
| 321 | } |
| 322 | |
| 323 | #footnotes { |
| 324 | margin: 20px 0 20px 0; |
| 325 | padding: 7px 0 0 0; |
| 326 | } |
| 327 | |
| 328 | #footnotes div.footnote { |
| 329 | margin: 0 0 5px 0; |
| 330 | } |
| 331 | |
| 332 | #footnotes hr { |
| 333 | border: none; |
| 334 | border-top: 1px solid silver; |
| 335 | height: 1px; |
| 336 | text-align: left; |
| 337 | margin-left: 0; |
| 338 | width: 20%; |
| 339 | min-width: 100px; |
| 340 | } |
| 341 | |
| 342 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 343 | @media print { |
| 344 | div#footer-badges { display: none; } |
| 345 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 346 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 347 | div#toc { |
| 348 | margin-bottom: 2.5em; |
| 349 | } |
| 350 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 351 | div#toctitle { |
| 352 | color: #527bbd; |
| 353 | font-family: sans-serif; |
| 354 | font-size: 1.1em; |
| 355 | font-weight: bold; |
| 356 | margin-top: 1.0em; |
| 357 | margin-bottom: 0.1em; |
| 358 | } |
| 359 | |
| 360 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 361 | margin-top: 0; |
| 362 | margin-bottom: 0; |
| 363 | } |
| 364 | div.toclevel2 { |
| 365 | margin-left: 2em; |
| 366 | font-size: 0.9em; |
| 367 | } |
| 368 | div.toclevel3 { |
| 369 | margin-left: 4em; |
| 370 | font-size: 0.9em; |
| 371 | } |
| 372 | div.toclevel4 { |
| 373 | margin-left: 6em; |
| 374 | font-size: 0.9em; |
| 375 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 376 | /* Overrides for manpage documents */ |
| 377 | h1 { |
| 378 | padding-top: 0.5em; |
| 379 | padding-bottom: 0.5em; |
| 380 | border-top: 2px solid silver; |
| 381 | border-bottom: 2px solid silver; |
| 382 | } |
| 383 | h2 { |
| 384 | border-style: none; |
| 385 | } |
| 386 | div.sectionbody { |
| 387 | margin-left: 5%; |
| 388 | } |
| 389 | |
| 390 | @media print { |
| 391 | div#toc { display: none; } |
| 392 | } |
| 393 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 394 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 395 | |
| 396 | div.sidebar-content { |
| 397 | background: #ffffee; |
| 398 | border: 1px solid silver; |
| 399 | padding: 0.5em; |
| 400 | } |
| 401 | div.sidebar-title, div.image-title { |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 402 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 403 | font-family: sans-serif; |
| 404 | font-weight: bold; |
| 405 | margin-top: 0.0em; |
| 406 | margin-bottom: 0.5em; |
| 407 | } |
| 408 | |
| 409 | div.listingblock div.content { |
| 410 | border: 1px solid silver; |
| 411 | background: #f4f4f4; |
| 412 | padding: 0.5em; |
| 413 | } |
| 414 | |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 415 | div.quoteblock-attribution { |
| 416 | padding-top: 0.5em; |
| 417 | text-align: right; |
| 418 | } |
| 419 | |
| 420 | div.verseblock-content { |
| 421 | white-space: pre; |
| 422 | } |
| 423 | div.verseblock-attribution { |
| 424 | padding-top: 0.75em; |
| 425 | text-align: left; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 426 | } |
| 427 | |
| 428 | div.exampleblock-content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 429 | border-left: 3px solid #dddddd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 430 | padding-left: 0.5em; |
| 431 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 432 | |
| 433 | /* IE6 sets dynamically generated links as visited. */ |
| 434 | div#toc a:visited { color: blue; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 435 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 436 | <script type="text/javascript"> |
| 437 | /*<+'])'); |
| 481 | // Function that scans the DOM tree for header elements (the DOM2 |
| 482 | // nodeIterator API would be a better technique but not supported by all |
| 483 | // browsers). |
| 484 | var iterate = function (el) { |
| 485 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 486 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 487 | var mo = re.exec(i.tagName); |
| 488 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 489 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 490 | } |
| 491 | iterate(i); |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | iterate(el); |
| 496 | return result; |
| 497 | } |
| 498 | |
| 499 | var toc = document.getElementById("toc"); |
| 500 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 501 | for (var i = 0; i < entries.length; ++i) { |
| 502 | var entry = entries[i]; |
| 503 | if (entry.element.id == "") |
| 504 | entry.element.id = "_toc_" + i; |
| 505 | var a = document.createElement("a"); |
| 506 | a.href = "#" + entry.element.id; |
| 507 | a.appendChild(document.createTextNode(entry.text)); |
| 508 | var div = document.createElement("div"); |
| 509 | div.appendChild(a); |
| 510 | div.className = "toclevel" + entry.toclevel; |
| 511 | toc.appendChild(div); |
| 512 | } |
| 513 | if (entries.length == 0) |
| 514 | toc.parentNode.removeChild(toc); |
| 515 | }, |
| 516 | |
| 517 | |
| 518 | ///////////////////////////////////////////////////////////////////// |
| 519 | // Footnotes generator |
| 520 | ///////////////////////////////////////////////////////////////////// |
| 521 | |
| 522 | /* Based on footnote generation code from: |
| 523 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 524 | */ |
| 525 | |
| 526 | footnotes: function () { |
| 527 | var cont = document.getElementById("content"); |
| 528 | var noteholder = document.getElementById("footnotes"); |
| 529 | var spans = cont.getElementsByTagName("span"); |
| 530 | var refs = {}; |
| 531 | var n = 0; |
| 532 | for (i=0; i<spans.length; i++) { |
| 533 | if (spans[i].className == "footnote") { |
| 534 | n++; |
| 535 | // Use [\s\S] in place of . so multi-line matches work. |
| 536 | // Because JavaScript has no s (dotall) regex flag. |
| 537 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 538 | noteholder.innerHTML += |
| 539 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 540 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 541 | n + "</a>. " + note + "</div>"; |
| 542 | spans[i].innerHTML = |
| 543 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 544 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 545 | var id =spans[i].getAttribute("id"); |
| 546 | if (id != null) refs["#"+id] = n; |
| 547 | } |
| 548 | } |
| 549 | if (n == 0) |
| 550 | noteholder.parentNode.removeChild(noteholder); |
| 551 | else { |
| 552 | // Process footnoterefs. |
| 553 | for (i=0; i<spans.length; i++) { |
| 554 | if (spans[i].className == "footnoteref") { |
| 555 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 556 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 557 | n = refs[href]; |
| 558 | spans[i].innerHTML = |
| 559 | "[<a href='#_footnote_" + n + |
| 560 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 561 | } |
| 562 | } |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | } |
| 567 | /*]]>*/ |
| 568 | </script> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 569 | </head> |
| 570 | <body> |
| 571 | <div id="header"> |
| 572 | <h1> |
| 573 | git-commit(1) Manual Page |
| 574 | </h1> |
| 575 | <h2>NAME</h2> |
| 576 | <div class="sectionbody"> |
| 577 | <p>git-commit - |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 578 | Record changes to the repository |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 579 | </p> |
| 580 | </div> |
| 581 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 582 | <div id="content"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 583 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 584 | <div class="sectionbody"> |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 585 | <div class="verseblock"> |
Junio C Hamano | 3d050d6 | 2011-05-17 06:43:34 | [diff] [blame] | 586 | <div class="verseblock-content"><em>git commit</em> [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend] |
| 587 | [--dry-run] [(-c | -C | --fixup | --squash) <commit>] |
| 588 | [-F <file> | -m <msg>] [--reset-author] [--allow-empty] |
| 589 | [--allow-empty-message] [--no-verify] [-e] [--author=<author>] |
| 590 | [--date=<date>] [--cleanup=<mode>] [--status | --no-status] |
| 591 | [-i | -o] [--] [<file>…]</div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 592 | <div class="verseblock-attribution"> |
| 593 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 594 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 595 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 596 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 597 | <div class="paragraph"><p>Stores the current contents of the index in a new commit along |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 598 | with a log message from the user describing the changes.</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 599 | <div class="paragraph"><p>The content to be added can be specified in several ways:</p></div> |
| 600 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 601 | <li> |
| 602 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 603 | by using <em>git add</em> to incrementally "add" changes to the |
Junio C Hamano | b515b6a | 2007-08-08 09:21:16 | [diff] [blame] | 604 | index before using the <em>commit</em> command (Note: even modified |
| 605 | files must be "added"); |
| 606 | </p> |
| 607 | </li> |
| 608 | <li> |
| 609 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 610 | by using <em>git rm</em> to remove files from the working tree |
Junio C Hamano | bd2b4bb | 2007-08-06 06:42:24 | [diff] [blame] | 611 | and the index, again before using the <em>commit</em> command; |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 612 | </p> |
| 613 | </li> |
| 614 | <li> |
| 615 | <p> |
Junio C Hamano | bd2b4bb | 2007-08-06 06:42:24 | [diff] [blame] | 616 | by listing files as arguments to the <em>commit</em> command, in which |
| 617 | case the commit will ignore changes staged in the index, and instead |
Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 618 | record the current content of the listed files (which must already |
| 619 | be known to git); |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 620 | </p> |
| 621 | </li> |
| 622 | <li> |
| 623 | <p> |
Junio C Hamano | bd2b4bb | 2007-08-06 06:42:24 | [diff] [blame] | 624 | by using the -a switch with the <em>commit</em> command to automatically |
| 625 | "add" changes from all known files (i.e. all files that are already |
| 626 | listed in the index) and to automatically "rm" files in the index |
| 627 | that have been removed from the working tree, and then perform the |
| 628 | actual commit; |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 629 | </p> |
| 630 | </li> |
Junio C Hamano | c51fede | 2007-03-12 07:29:20 | [diff] [blame] | 631 | <li> |
| 632 | <p> |
Junio C Hamano | 3d050d6 | 2011-05-17 06:43:34 | [diff] [blame] | 633 | by using the --interactive or --patch switches with the <em>commit</em> command |
| 634 | to decide one by one which files or hunks should be part of the commit, |
Junio C Hamano | b76a686 | 2012-05-02 22:02:46 | [diff] [blame] | 635 | before finalizing the operation. See the “Interactive Mode” section of |
Junio C Hamano | 3d050d6 | 2011-05-17 06:43:34 | [diff] [blame] | 636 | <a href="git-add.html">git-add(1)</a> to learn how to operate these modes. |
Junio C Hamano | c51fede | 2007-03-12 07:29:20 | [diff] [blame] | 637 | </p> |
| 638 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 639 | </ol></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 640 | <div class="paragraph"><p>The <tt>--dry-run</tt> option can be used to obtain a |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 641 | summary of what is included by any of the above for the next |
Junio C Hamano | 1bb3199 | 2009-08-29 04:24:08 | [diff] [blame] | 642 | commit by giving the same set of parameters (options and paths).</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 643 | <div class="paragraph"><p>If you make a commit and then find a mistake immediately after |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 644 | that, you can recover from it with <em>git reset</em>.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 645 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 646 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 647 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 648 | <div class="dlist"><dl> |
| 649 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 650 | -a |
| 651 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 652 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 653 | --all |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 654 | </dt> |
| 655 | <dd> |
| 656 | <p> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 657 | Tell the command to automatically stage files that have |
| 658 | been modified and deleted, but new files you have not |
| 659 | told git about are not affected. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 660 | </p> |
| 661 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 662 | <dt class="hdlist1"> |
Junio C Hamano | 3d050d6 | 2011-05-17 06:43:34 | [diff] [blame] | 663 | -p |
| 664 | </dt> |
| 665 | <dt class="hdlist1"> |
| 666 | --patch |
| 667 | </dt> |
| 668 | <dd> |
| 669 | <p> |
| 670 | Use the interactive patch selection interface to chose |
| 671 | which changes to commit. See <a href="git-add.html">git-add(1)</a> for |
| 672 | details. |
| 673 | </p> |
| 674 | </dd> |
| 675 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 676 | -C <commit> |
| 677 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 678 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 679 | --reuse-message=<commit> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 680 | </dt> |
| 681 | <dd> |
| 682 | <p> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 683 | Take an existing commit object, and reuse the log message |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 684 | and the authorship information (including the timestamp) |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 685 | when creating the commit. |
| 686 | </p> |
| 687 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 688 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 689 | -c <commit> |
| 690 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 691 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 692 | --reedit-message=<commit> |
| 693 | </dt> |
| 694 | <dd> |
| 695 | <p> |
| 696 | Like <em>-C</em>, but with <em>-c</em> the editor is invoked, so that |
| 697 | the user can further edit the commit message. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 698 | </p> |
| 699 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 700 | <dt class="hdlist1"> |
Junio C Hamano | 2e6ded8 | 2010-12-05 06:20:48 | [diff] [blame] | 701 | --fixup=<commit> |
| 702 | </dt> |
| 703 | <dd> |
| 704 | <p> |
| 705 | Construct a commit message for use with <tt>rebase --autosquash</tt>. |
| 706 | The commit message will be the subject line from the specified |
| 707 | commit with a prefix of "fixup! ". See <a href="git-rebase.html">git-rebase(1)</a> |
| 708 | for details. |
| 709 | </p> |
| 710 | </dd> |
| 711 | <dt class="hdlist1"> |
| 712 | --squash=<commit> |
| 713 | </dt> |
| 714 | <dd> |
| 715 | <p> |
| 716 | Construct a commit message for use with <tt>rebase --autosquash</tt>. |
| 717 | The commit message subject line is taken from the specified |
| 718 | commit with a prefix of "squash! ". Can be used with additional |
| 719 | commit message options (<tt>-m</tt>/<tt>-c</tt>/<tt>-C</tt>/<tt>-F</tt>). See |
| 720 | <a href="git-rebase.html">git-rebase(1)</a> for details. |
| 721 | </p> |
| 722 | </dd> |
| 723 | <dt class="hdlist1"> |
Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 724 | --reset-author |
| 725 | </dt> |
| 726 | <dd> |
| 727 | <p> |
Junio C Hamano | a8cc1d8 | 2011-03-10 01:18:12 | [diff] [blame] | 728 | When used with -C/-c/--amend options, or when committing after a |
| 729 | a conflicting cherry-pick, declare that the authorship of the |
| 730 | resulting commit now belongs of the committer. This also renews |
| 731 | the author timestamp. |
Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 732 | </p> |
| 733 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 734 | <dt class="hdlist1"> |
Junio C Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 735 | --short |
| 736 | </dt> |
| 737 | <dd> |
| 738 | <p> |
| 739 | When doing a dry-run, give the output in the short-format. See |
| 740 | <a href="git-status.html">git-status(1)</a> for details. Implies <tt>--dry-run</tt>. |
| 741 | </p> |
| 742 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 743 | <dt class="hdlist1"> |
Junio C Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 744 | --porcelain |
| 745 | </dt> |
| 746 | <dd> |
| 747 | <p> |
| 748 | When doing a dry-run, give the output in a porcelain-ready |
| 749 | format. See <a href="git-status.html">git-status(1)</a> for details. Implies |
| 750 | <tt>--dry-run</tt>. |
| 751 | </p> |
| 752 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 753 | <dt class="hdlist1"> |
Junio C Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 754 | -z |
| 755 | </dt> |
| 756 | <dd> |
| 757 | <p> |
| 758 | When showing <tt>short</tt> or <tt>porcelain</tt> status output, terminate |
| 759 | entries in the status output with NUL, instead of LF. If no |
| 760 | format is given, implies the <tt>--porcelain</tt> output format. |
| 761 | </p> |
| 762 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 763 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 764 | -F <file> |
| 765 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 766 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 767 | --file=<file> |
| 768 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 769 | <dd> |
| 770 | <p> |
| 771 | Take the commit message from the given file. Use <em>-</em> to |
| 772 | read the message from the standard input. |
| 773 | </p> |
| 774 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 775 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 776 | --author=<author> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 777 | </dt> |
| 778 | <dd> |
| 779 | <p> |
Junio C Hamano | 13002fb | 2010-06-08 05:53:58 | [diff] [blame] | 780 | Override the commit author. Specify an explicit author using the |
Junio C Hamano | b76a686 | 2012-05-02 22:02:46 | [diff] [blame] | 781 | standard <tt>A U Thor <author@example.com></tt> format. Otherwise <author> |
Junio C Hamano | 13002fb | 2010-06-08 05:53:58 | [diff] [blame] | 782 | is assumed to be a pattern and is used to search for an existing |
| 783 | commit by that author (i.e. rev-list --all -i --author=<author>); |
| 784 | the commit author is then copied from the first such commit found. |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 785 | </p> |
| 786 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 787 | <dt class="hdlist1"> |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 788 | --date=<date> |
| 789 | </dt> |
| 790 | <dd> |
| 791 | <p> |
| 792 | Override the author date used in the commit. |
| 793 | </p> |
| 794 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 795 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 796 | -m <msg> |
| 797 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 798 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 799 | --message=<msg> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 800 | </dt> |
| 801 | <dd> |
| 802 | <p> |
| 803 | Use the given <msg> as the commit message. |
| 804 | </p> |
| 805 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 806 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 807 | -t <file> |
| 808 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 809 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 810 | --template=<file> |
Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 811 | </dt> |
| 812 | <dd> |
| 813 | <p> |
Junio C Hamano | 51f87de | 2012-04-16 21:18:54 | [diff] [blame] | 814 | When editing the commit message, start the editor with the |
| 815 | contents in the given file. The <tt>commit.template</tt> configuration |
| 816 | variable is often used to give this option implicitly to the |
| 817 | command. This mechanism can be used by projects that want to |
| 818 | guide participants with some hints on what to write in the message |
| 819 | in what order. If the user exits the editor without editing the |
| 820 | message, the commit is aborted. This has no effect when a message |
| 821 | is given by other means, e.g. with the <tt>-m</tt> or <tt>-F</tt> options. |
Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 822 | </p> |
| 823 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 824 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 825 | -s |
| 826 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 827 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 828 | --signoff |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 829 | </dt> |
| 830 | <dd> |
| 831 | <p> |
Junio C Hamano | 610d176 | 2008-11-28 06:27:13 | [diff] [blame] | 832 | Add Signed-off-by line by the committer at the end of the commit |
Junio C Hamano | 7d06a8a | 2008-10-20 05:42:33 | [diff] [blame] | 833 | log message. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 834 | </p> |
| 835 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 836 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 837 | -n |
| 838 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 839 | <dt class="hdlist1"> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 840 | --no-verify |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 841 | </dt> |
| 842 | <dd> |
| 843 | <p> |
Junio C Hamano | 942b35e | 2007-12-09 10:19:33 | [diff] [blame] | 844 | This option bypasses the pre-commit and commit-msg hooks. |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 845 | See also <a href="githooks.html">githooks(5)</a>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 846 | </p> |
| 847 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 848 | <dt class="hdlist1"> |
Junio C Hamano | 0c99970 | 2007-12-03 09:57:55 | [diff] [blame] | 849 | --allow-empty |
| 850 | </dt> |
| 851 | <dd> |
| 852 | <p> |
| 853 | Usually recording a commit that has the exact same tree as its |
Junio C Hamano | 5825687 | 2007-12-04 08:31:13 | [diff] [blame] | 854 | sole parent commit is a mistake, and the command prevents you |
| 855 | from making such a commit. This option bypasses the safety, and |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 856 | is primarily for use by foreign SCM interface scripts. |
Junio C Hamano | 0c99970 | 2007-12-03 09:57:55 | [diff] [blame] | 857 | </p> |
| 858 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 859 | <dt class="hdlist1"> |
Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 860 | --allow-empty-message |
| 861 | </dt> |
| 862 | <dd> |
| 863 | <p> |
| 864 | Like --allow-empty this command is primarily for use by foreign |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 865 | SCM interface scripts. It allows you to create a commit with an |
Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 866 | empty commit message without using plumbing commands like |
| 867 | <a href="git-commit-tree.html">git-commit-tree(1)</a>. |
| 868 | </p> |
| 869 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 870 | <dt class="hdlist1"> |
Junio C Hamano | 554da79 | 2007-12-27 03:29:58 | [diff] [blame] | 871 | --cleanup=<mode> |
| 872 | </dt> |
| 873 | <dd> |
| 874 | <p> |
| 875 | This option sets how the commit message is cleaned up. |
| 876 | The <em><mode></em> can be one of <em>verbatim</em>, <em>whitespace</em>, <em>strip</em>, |
| 877 | and <em>default</em>. The <em>default</em> mode will strip leading and |
| 878 | trailing empty lines and #commentary from the commit message |
| 879 | only if the message is to be edited. Otherwise only whitespace |
| 880 | removed. The <em>verbatim</em> mode does not change message at all, |
| 881 | <em>whitespace</em> removes just leading/trailing whitespace lines |
| 882 | and <em>strip</em> removes both whitespace and commentary. |
| 883 | </p> |
| 884 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 885 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 886 | -e |
| 887 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 888 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 889 | --edit |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 890 | </dt> |
| 891 | <dd> |
| 892 | <p> |
| 893 | The message taken from file with <tt>-F</tt>, command line with |
| 894 | <tt>-m</tt>, and from file with <tt>-C</tt> are usually used as the |
| 895 | commit log message unmodified. This option lets you |
| 896 | further edit the message taken from these sources. |
| 897 | </p> |
| 898 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 899 | <dt class="hdlist1"> |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 900 | --amend |
| 901 | </dt> |
| 902 | <dd> |
| 903 | <p> |
| 904 | Used to amend the tip of the current branch. Prepare the tree |
| 905 | object you would want to replace the latest commit as usual |
| 906 | (this includes the usual -i/-o and explicit paths), and the |
| 907 | commit log editor is seeded with the commit message from the |
| 908 | tip of the current branch. The commit you create replaces the |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 909 | current tip — if it was a merge, it will have the parents of |
| 910 | the current tip as parents — so the current top commit is |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 911 | discarded. |
| 912 | </p> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 913 | <div class="paragraph"><p>It is a rough equivalent for:</p></div> |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 914 | <div class="listingblock"> |
| 915 | <div class="content"> |
| 916 | <pre><tt> $ git reset --soft HEAD^ |
| 917 | $ ... do something else to come up with the right tree ... |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 918 | $ git commit -c ORIG_HEAD</tt></pre> |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 919 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 920 | <div class="paragraph"><p>but can be used to amend a merge commit.</p></div> |
| 921 | <div class="paragraph"><p>You should understand the implications of rewriting history if you |
Junio C Hamano | 7d06a8a | 2008-10-20 05:42:33 | [diff] [blame] | 922 | amend a commit that has already been published. (See the "RECOVERING |
| 923 | FROM UPSTREAM REBASE" section in <a href="git-rebase.html">git-rebase(1)</a>.)</p></div> |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 924 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 925 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 926 | -i |
| 927 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 928 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 929 | --include |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 930 | </dt> |
| 931 | <dd> |
| 932 | <p> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 933 | Before making a commit out of staged contents so far, |
| 934 | stage the contents of paths given on the command line |
| 935 | as well. This is usually not what you want unless you |
| 936 | are concluding a conflicted merge. |
Junio C Hamano | 6697ac5 | 2006-02-14 08:00:23 | [diff] [blame] | 937 | </p> |
| 938 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 939 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 940 | -o |
| 941 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 942 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 943 | --only |
Junio C Hamano | e79159d | 2008-04-12 08:23:17 | [diff] [blame] | 944 | </dt> |
| 945 | <dd> |
| 946 | <p> |
| 947 | Make a commit only from the paths specified on the |
| 948 | command line, disregarding any contents that have been |
| 949 | staged so far. This is the default mode of operation of |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 950 | <em>git commit</em> if any paths are given on the command line, |
Junio C Hamano | e79159d | 2008-04-12 08:23:17 | [diff] [blame] | 951 | in which case this option can be omitted. |
| 952 | If this option is specified together with <em>--amend</em>, then |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 953 | no paths need to be specified, which can be used to amend |
Junio C Hamano | e79159d | 2008-04-12 08:23:17 | [diff] [blame] | 954 | the last commit without committing changes that have |
| 955 | already been staged. |
| 956 | </p> |
| 957 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 958 | <dt class="hdlist1"> |
Junio C Hamano | 4224f99 | 2008-06-23 07:14:08 | [diff] [blame] | 959 | -u[<mode>] |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 960 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 961 | <dt class="hdlist1"> |
Junio C Hamano | 4224f99 | 2008-06-23 07:14:08 | [diff] [blame] | 962 | --untracked-files[=<mode>] |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 963 | </dt> |
| 964 | <dd> |
| 965 | <p> |
Junio C Hamano | 36a4dbc | 2011-02-22 07:51:32 | [diff] [blame] | 966 | Show untracked files. |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 967 | </p> |
Junio C Hamano | 36a4dbc | 2011-02-22 07:51:32 | [diff] [blame] | 968 | <div class="paragraph"><p>The mode parameter is optional (defaults to <em>all</em>), and is used to |
| 969 | specify the handling of untracked files; when -u is not used, the |
| 970 | default is <em>normal</em>, i.e. show untracked files and directories.</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 971 | <div class="paragraph"><p>The possible options are:</p></div> |
| 972 | <div class="ulist"><ul> |
Junio C Hamano | 4224f99 | 2008-06-23 07:14:08 | [diff] [blame] | 973 | <li> |
| 974 | <p> |
| 975 | <em>no</em> - Show no untracked files |
| 976 | </p> |
| 977 | </li> |
| 978 | <li> |
| 979 | <p> |
| 980 | <em>normal</em> - Shows untracked files and directories |
| 981 | </p> |
| 982 | </li> |
| 983 | <li> |
| 984 | <p> |
| 985 | <em>all</em> - Also shows individual files in untracked directories. |
| 986 | </p> |
Junio C Hamano | 36a4dbc | 2011-02-22 07:51:32 | [diff] [blame] | 987 | <div class="paragraph"><p>The default can be changed using the status.showUntrackedFiles |
| 988 | configuration variable documented in <a href="git-config.html">git-config(1)</a>.</p></div> |
Junio C Hamano | e1cca18 | 2010-02-20 20:01:23 | [diff] [blame] | 989 | </li> |
| 990 | </ul></div> |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 991 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 992 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 993 | -v |
| 994 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 995 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 996 | --verbose |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 997 | </dt> |
| 998 | <dd> |
| 999 | <p> |
| 1000 | Show unified diff between the HEAD commit and what |
| 1001 | would be committed at the bottom of the commit message |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1002 | template. Note that this diff output doesn’t have its |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1003 | lines prefixed with <em>#</em>. |
| 1004 | </p> |
| 1005 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1006 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1007 | -q |
| 1008 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1009 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1010 | --quiet |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 1011 | </dt> |
| 1012 | <dd> |
| 1013 | <p> |
Junio C Hamano | f9771f6 | 2007-01-17 17:42:30 | [diff] [blame] | 1014 | Suppress commit summary message. |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 1015 | </p> |
| 1016 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1017 | <dt class="hdlist1"> |
Junio C Hamano | 1bb3199 | 2009-08-29 04:24:08 | [diff] [blame] | 1018 | --dry-run |
| 1019 | </dt> |
| 1020 | <dd> |
| 1021 | <p> |
| 1022 | Do not create a commit, but show a list of paths that are |
| 1023 | to be committed, paths with local changes that will be left |
| 1024 | uncommitted and paths that are untracked. |
| 1025 | </p> |
| 1026 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1027 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1028 | --status |
| 1029 | </dt> |
| 1030 | <dd> |
| 1031 | <p> |
| 1032 | Include the output of <a href="git-status.html">git-status(1)</a> in the commit |
| 1033 | message template when using an editor to prepare the commit |
| 1034 | message. Defaults to on, but can be used to override |
| 1035 | configuration variable commit.status. |
| 1036 | </p> |
| 1037 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1038 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1039 | --no-status |
| 1040 | </dt> |
| 1041 | <dd> |
| 1042 | <p> |
| 1043 | Do not include the output of <a href="git-status.html">git-status(1)</a> in the |
| 1044 | commit message template when using an editor to prepare the |
| 1045 | default commit message. |
| 1046 | </p> |
| 1047 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1048 | <dt class="hdlist1"> |
Junio C Hamano | 1bb569e | 2006-05-05 23:14:25 | [diff] [blame] | 1049 | -- |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1050 | </dt> |
| 1051 | <dd> |
| 1052 | <p> |
| 1053 | Do not interpret any more arguments as options. |
| 1054 | </p> |
| 1055 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1056 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1057 | <file>… |
| 1058 | </dt> |
| 1059 | <dd> |
| 1060 | <p> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1061 | When files are given on the command line, the command |
| 1062 | commits the contents of the named files, without |
| 1063 | recording the changes already staged. The contents of |
| 1064 | these files are also staged for the next commit on top |
| 1065 | of what have been staged before. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1066 | </p> |
| 1067 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1068 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1069 | </div> |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 1070 | <h2 id="_date_formats">DATE FORMATS</h2> |
| 1071 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1072 | <div class="paragraph"><p>The GIT_AUTHOR_DATE, GIT_COMMITTER_DATE environment variables |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 1073 | and the <tt>--date</tt> option |
| 1074 | support the following date formats:</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1075 | <div class="dlist"><dl> |
| 1076 | <dt class="hdlist1"> |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 1077 | Git internal format |
| 1078 | </dt> |
| 1079 | <dd> |
| 1080 | <p> |
| 1081 | It is <tt><unix timestamp> <timezone offset></tt>, where <tt><unix |
| 1082 | timestamp></tt> is the number of seconds since the UNIX epoch. |
| 1083 | <tt><timezone offset></tt> is a positive or negative offset from UTC. |
| 1084 | For example CET (which is 2 hours ahead UTC) is <tt>+0200</tt>. |
| 1085 | </p> |
| 1086 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1087 | <dt class="hdlist1"> |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 1088 | RFC 2822 |
| 1089 | </dt> |
| 1090 | <dd> |
| 1091 | <p> |
| 1092 | The standard email format as described by RFC 2822, for example |
| 1093 | <tt>Thu, 07 Apr 2005 22:13:13 +0200</tt>. |
| 1094 | </p> |
| 1095 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1096 | <dt class="hdlist1"> |
Junio C Hamano | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 1097 | ISO 8601 |
| 1098 | </dt> |
| 1099 | <dd> |
| 1100 | <p> |
| 1101 | Time and date specified by the ISO 8601 standard, for example |
| 1102 | <tt>2005-04-07T22:13:13</tt>. The parser accepts a space instead of the |
| 1103 | <tt>T</tt> character as well. |
| 1104 | </p> |
| 1105 | <div class="admonitionblock"> |
| 1106 | <table><tr> |
| 1107 | <td class="icon"> |
| 1108 | <div class="title">Note</div> |
| 1109 | </td> |
| 1110 | <td class="content">In addition, the date part is accepted in the following formats: |
| 1111 | <tt>YYYY.MM.DD</tt>, <tt>MM/DD/YYYY</tt> and <tt>DD.MM.YYYY</tt>.</td> |
| 1112 | </tr></table> |
| 1113 | </div> |
| 1114 | </dd> |
| 1115 | </dl></div> |
| 1116 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1117 | <h2 id="_examples">EXAMPLES</h2> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1118 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1119 | <div class="paragraph"><p>When recording your own work, the contents of modified files in |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1120 | your working tree are temporarily stored to a staging area |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1121 | called the "index" with <em>git add</em>. A file can be |
Junio C Hamano | 361c133 | 2007-11-14 12:17:22 | [diff] [blame] | 1122 | reverted back, only in the index but not in the working tree, |
Junio C Hamano | 360e3a1 | 2011-07-13 23:51:56 | [diff] [blame] | 1123 | to that of the last commit with <tt>git reset HEAD -- <file></tt>, |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1124 | which effectively reverts <em>git add</em> and prevents the changes to |
Junio C Hamano | 361c133 | 2007-11-14 12:17:22 | [diff] [blame] | 1125 | this file from participating in the next commit. After building |
| 1126 | the state to be committed incrementally with these commands, |
| 1127 | <tt>git commit</tt> (without any pathname parameter) is used to record what |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1128 | has been staged so far. This is the most basic form of the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1129 | command. An example:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1130 | <div class="listingblock"> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1131 | <div class="content"> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1132 | <pre><tt>$ edit hello.c |
| 1133 | $ git rm goodbye.c |
| 1134 | $ git add hello.c |
| 1135 | $ git commit</tt></pre> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1136 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1137 | <div class="paragraph"><p>Instead of staging files after each individual change, you can |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1138 | tell <tt>git commit</tt> to notice the changes to the files whose |
| 1139 | contents are tracked in |
| 1140 | your working tree and do corresponding <tt>git add</tt> and <tt>git rm</tt> |
| 1141 | for you. That is, this example does the same as the earlier |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1142 | example if there is no other change in your working tree:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1143 | <div class="listingblock"> |
| 1144 | <div class="content"> |
| 1145 | <pre><tt>$ edit hello.c |
| 1146 | $ rm goodbye.c |
| 1147 | $ git commit -a</tt></pre> |
| 1148 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1149 | <div class="paragraph"><p>The command <tt>git commit -a</tt> first looks at your working tree, |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1150 | notices that you have modified hello.c and removed goodbye.c, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1151 | and performs necessary <tt>git add</tt> and <tt>git rm</tt> for you.</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1152 | <div class="paragraph"><p>After staging changes to many files, you can alter the order the |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1153 | changes are recorded in, by giving pathnames to <tt>git commit</tt>. |
| 1154 | When pathnames are given, the command makes a commit that |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1155 | only records the changes made to the named paths:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1156 | <div class="listingblock"> |
| 1157 | <div class="content"> |
| 1158 | <pre><tt>$ edit hello.c hello.h |
| 1159 | $ git add hello.c hello.h |
| 1160 | $ edit Makefile |
| 1161 | $ git commit Makefile</tt></pre> |
| 1162 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1163 | <div class="paragraph"><p>This makes a commit that records the modification to <tt>Makefile</tt>. |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1164 | The changes staged for <tt>hello.c</tt> and <tt>hello.h</tt> are not included |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1165 | in the resulting commit. However, their changes are not lost — they are still staged and merely held back. After the above |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1166 | sequence, if you do:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1167 | <div class="listingblock"> |
| 1168 | <div class="content"> |
| 1169 | <pre><tt>$ git commit</tt></pre> |
| 1170 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1171 | <div class="paragraph"><p>this second commit would record the changes to <tt>hello.c</tt> and |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1172 | <tt>hello.h</tt> as expected.</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1173 | <div class="paragraph"><p>After a merge (initiated by <em>git merge</em> or <em>git pull</em>) stops |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 1174 | because of conflicts, cleanly merged |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1175 | paths are already staged to be committed for you, and paths that |
| 1176 | conflicted are left in unmerged state. You would have to first |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1177 | check which paths are conflicting with <em>git status</em> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1178 | and after fixing them manually in your working tree, you would |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1179 | stage the result as usual with <em>git add</em>:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1180 | <div class="listingblock"> |
| 1181 | <div class="content"> |
| 1182 | <pre><tt>$ git status | grep unmerged |
| 1183 | unmerged: hello.c |
| 1184 | $ edit hello.c |
| 1185 | $ git add hello.c</tt></pre> |
| 1186 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1187 | <div class="paragraph"><p>After resolving conflicts and staging the result, <tt>git ls-files -u</tt> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1188 | would stop mentioning the conflicted path. When you are done, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1189 | run <tt>git commit</tt> to finally record the merge:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1190 | <div class="listingblock"> |
| 1191 | <div class="content"> |
| 1192 | <pre><tt>$ git commit</tt></pre> |
| 1193 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1194 | <div class="paragraph"><p>As with the case to record your own changes, you can use <tt>-a</tt> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1195 | option to save typing. One difference is that during a merge |
| 1196 | resolution, you cannot use <tt>git commit</tt> with pathnames to |
| 1197 | alter the order the changes are committed, because the merge |
| 1198 | should be recorded as a single commit. In fact, the command |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1199 | refuses to run when given pathnames (but see <tt>-i</tt> option).</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1200 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1201 | <h2 id="_discussion">DISCUSSION</h2> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1202 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1203 | <div class="paragraph"><p>Though not required, it’s a good idea to begin the commit message |
Junio C Hamano | 8f76dc6 | 2007-01-17 07:24:25 | [diff] [blame] | 1204 | with a single short (less than 50 character) line summarizing the |
| 1205 | change, followed by a blank line and then a more thorough description. |
| 1206 | Tools that turn commits into email, for example, use the first line |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1207 | on the Subject: line and the rest of the commit in the body.</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1208 | <div class="paragraph"><p>At the core level, git is character encoding agnostic.</p></div> |
| 1209 | <div class="ulist"><ul> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1210 | <li> |
| 1211 | <p> |
| 1212 | The pathnames recorded in the index and in the tree objects |
| 1213 | are treated as uninterpreted sequences of non-NUL bytes. |
| 1214 | What readdir(2) returns are what are recorded and compared |
| 1215 | with the data git keeps track of, which in turn are expected |
| 1216 | to be what lstat(2) and creat(2) accepts. There is no such |
| 1217 | thing as pathname encoding translation. |
| 1218 | </p> |
| 1219 | </li> |
| 1220 | <li> |
| 1221 | <p> |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 1222 | The contents of the blob objects are uninterpreted sequences |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1223 | of bytes. There is no encoding translation at the core |
| 1224 | level. |
| 1225 | </p> |
| 1226 | </li> |
| 1227 | <li> |
| 1228 | <p> |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 1229 | The commit log messages are uninterpreted sequences of non-NUL |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1230 | bytes. |
| 1231 | </p> |
| 1232 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1233 | </ul></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1234 | <div class="paragraph"><p>Although we encourage that the commit log messages are encoded |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1235 | in UTF-8, both the core and git Porcelain are designed not to |
| 1236 | force UTF-8 on projects. If all participants of a particular |
| 1237 | project find it more convenient to use legacy encodings, git |
| 1238 | does not forbid it. However, there are a few things to keep in |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1239 | mind.</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1240 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1241 | <li> |
| 1242 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1243 | <em>git commit</em> and <em>git commit-tree</em> issues |
Junio C Hamano | 14b7648 | 2008-01-05 10:32:26 | [diff] [blame] | 1244 | a warning if the commit log message given to it does not look |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1245 | like a valid UTF-8 string, unless you explicitly say your |
| 1246 | project uses a legacy encoding. The way to say this is to |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1247 | have i18n.commitencoding in <tt>.git/config</tt> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1248 | </p> |
| 1249 | <div class="listingblock"> |
| 1250 | <div class="content"> |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1251 | <pre><tt>[i18n] |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1252 | commitencoding = ISO-8859-1</tt></pre> |
| 1253 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1254 | <div class="paragraph"><p>Commit objects created with the above setting record the value |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1255 | of <tt>i18n.commitencoding</tt> in its <tt>encoding</tt> header. This is to |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1256 | help other people who look at them later. Lack of this header |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1257 | implies that the commit log message is encoded in UTF-8.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1258 | </li> |
| 1259 | <li> |
| 1260 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1261 | <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1262 | <tt>encoding</tt> header of a commit object, and try to re-code the |
| 1263 | log message into UTF-8 unless otherwise specified. You can |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1264 | specify the desired output encoding with |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1265 | <tt>i18n.logoutputencoding</tt> in <tt>.git/config</tt> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1266 | </p> |
| 1267 | <div class="listingblock"> |
| 1268 | <div class="content"> |
Junio C Hamano | 35bb3f6 | 2007-02-19 05:35:53 | [diff] [blame] | 1269 | <pre><tt>[i18n] |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1270 | logoutputencoding = ISO-8859-1</tt></pre> |
| 1271 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1272 | <div class="paragraph"><p>If you do not have this configuration variable, the value of |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1273 | <tt>i18n.commitencoding</tt> is used instead.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1274 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1275 | </ol></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1276 | <div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1277 | message when a commit is made to force UTF-8 at the commit |
| 1278 | object level, because re-coding to UTF-8 is not necessarily a |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1279 | reversible operation.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1280 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1281 | <h2 id="_environment_and_configuration_variables">ENVIRONMENT AND CONFIGURATION VARIABLES</h2> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1282 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1283 | <div class="paragraph"><p>The editor used to edit the commit log message will be chosen from the |
Junio C Hamano | f6002a9 | 2007-07-20 10:28:22 | [diff] [blame] | 1284 | GIT_EDITOR environment variable, the core.editor configuration variable, the |
| 1285 | VISUAL environment variable, or the EDITOR environment variable (in that |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1286 | order). See <a href="git-var.html">git-var(1)</a> for details.</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1287 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1288 | <h2 id="_hooks">HOOKS</h2> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1289 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1290 | <div class="paragraph"><p>This command can run <tt>commit-msg</tt>, <tt>prepare-commit-msg</tt>, <tt>pre-commit</tt>, |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 1291 | and <tt>post-commit</tt> hooks. See <a href="githooks.html">githooks(5)</a> for more |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1292 | information.</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1293 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1294 | <h2 id="_see_also">SEE ALSO</h2> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1295 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1296 | <div class="paragraph"><p><a href="git-add.html">git-add(1)</a>, |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1297 | <a href="git-rm.html">git-rm(1)</a>, |
| 1298 | <a href="git-mv.html">git-mv(1)</a>, |
| 1299 | <a href="git-merge.html">git-merge(1)</a>, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1300 | <a href="git-commit-tree.html">git-commit-tree(1)</a></p></div> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1301 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1302 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1303 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1304 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1305 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1306 | </div> |
| 1307 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1308 | <div id="footer"> |
| 1309 | <div id="footer-text"> |
Junio C Hamano | b76a686 | 2012-05-02 22:02:46 | [diff] [blame] | 1310 | Last updated 2012-05-02 15:00:44 PDT |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1311 | </div> |
| 1312 | </div> |
| 1313 | </body> |
| 1314 | </html> |