Junio C Hamano | 944ce25 | 2018-05-30 22:25:26 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2 | <!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 Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 6 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
Junio C Hamano | 4bea028 | 2022-04-04 18:21:49 | [diff] [blame] | 7 | <meta name="generator" content="AsciiDoc 10.1.2" /> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 8 | <title>git-commit(1)</title> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 9 | <style type="text/css"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 10 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 11 | |
| 12 | /* Default font. */ |
| 13 | body { |
| 14 | font-family: Georgia,serif; |
| 15 | } |
| 16 | |
| 17 | /* Title font. */ |
| 18 | h1, h2, h3, h4, h5, h6, |
| 19 | div.title, caption.title, |
| 20 | thead, p.table.header, |
| 21 | #toctitle, |
| 22 | #author, #revnumber, #revdate, #revremark, |
| 23 | #footer { |
| 24 | font-family: Arial,Helvetica,sans-serif; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | body { |
| 28 | margin: 1em 5% 1em 5%; |
| 29 | } |
| 30 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 31 | a { |
| 32 | color: blue; |
| 33 | text-decoration: underline; |
| 34 | } |
| 35 | a:visited { |
| 36 | color: fuchsia; |
| 37 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 38 | |
| 39 | em { |
| 40 | font-style: italic; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 41 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | strong { |
| 45 | font-weight: bold; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 46 | color: #083194; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 47 | } |
| 48 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 49 | h1, h2, h3, h4, h5, h6 { |
| 50 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 51 | margin-top: 1.2em; |
| 52 | margin-bottom: 0.5em; |
| 53 | line-height: 1.3; |
| 54 | } |
| 55 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 56 | h1, h2, h3 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 57 | border-bottom: 2px solid silver; |
| 58 | } |
| 59 | h2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 60 | padding-top: 0.5em; |
| 61 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 62 | h3 { |
| 63 | float: left; |
| 64 | } |
| 65 | h3 + * { |
| 66 | clear: left; |
| 67 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 68 | h5 { |
| 69 | font-size: 1.0em; |
| 70 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 71 | |
| 72 | div.sectionbody { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 73 | margin-left: 0; |
| 74 | } |
| 75 | |
| 76 | hr { |
| 77 | border: 1px solid silver; |
| 78 | } |
| 79 | |
| 80 | p { |
| 81 | margin-top: 0.5em; |
| 82 | margin-bottom: 0.5em; |
| 83 | } |
| 84 | |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 85 | ul, ol, li > p { |
| 86 | margin-top: 0; |
| 87 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 88 | ul > li { color: #aaa; } |
| 89 | ul > li > * { color: black; } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 90 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 91 | .monospaced, code, pre { |
| 92 | font-family: "Courier New", Courier, monospace; |
| 93 | font-size: inherit; |
| 94 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 95 | padding: 0; |
| 96 | margin: 0; |
| 97 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 98 | pre { |
| 99 | white-space: pre-wrap; |
| 100 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 101 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 102 | #author { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 103 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 104 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 105 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 106 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 107 | #email { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 108 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 109 | #revnumber, #revdate, #revremark { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 110 | } |
| 111 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 112 | #footer { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 113 | font-size: small; |
| 114 | border-top: 2px solid silver; |
| 115 | padding-top: 0.5em; |
| 116 | margin-top: 4.0em; |
| 117 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 118 | #footer-text { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 119 | float: left; |
| 120 | padding-bottom: 0.5em; |
| 121 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 122 | #footer-badges { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 123 | float: right; |
| 124 | padding-bottom: 0.5em; |
| 125 | } |
| 126 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 127 | #preamble { |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 128 | margin-top: 1.5em; |
| 129 | margin-bottom: 1.5em; |
| 130 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 131 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 132 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 133 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 134 | margin-top: 1.0em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 135 | margin-bottom: 1.5em; |
| 136 | } |
| 137 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 138 | margin-top: 2.0em; |
| 139 | margin-bottom: 2.0em; |
| 140 | margin-right: 10%; |
| 141 | color: #606060; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | div.content { /* Block element content. */ |
| 145 | padding: 0; |
| 146 | } |
| 147 | |
| 148 | /* Block element titles. */ |
| 149 | div.title, caption.title { |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 150 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 151 | font-weight: bold; |
| 152 | text-align: left; |
| 153 | margin-top: 1.0em; |
| 154 | margin-bottom: 0.5em; |
| 155 | } |
| 156 | div.title + * { |
| 157 | margin-top: 0; |
| 158 | } |
| 159 | |
| 160 | td div.title:first-child { |
| 161 | margin-top: 0.0em; |
| 162 | } |
| 163 | div.content div.title:first-child { |
| 164 | margin-top: 0.0em; |
| 165 | } |
| 166 | div.content + div.title { |
| 167 | margin-top: 0.0em; |
| 168 | } |
| 169 | |
| 170 | div.sidebarblock > div.content { |
| 171 | background: #ffffee; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 172 | border: 1px solid #dddddd; |
| 173 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 174 | padding: 0.5em; |
| 175 | } |
| 176 | |
| 177 | div.listingblock > div.content { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 178 | border: 1px solid #dddddd; |
| 179 | border-left: 5px solid #f0f0f0; |
| 180 | background: #f8f8f8; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 181 | padding: 0.5em; |
| 182 | } |
| 183 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 184 | div.quoteblock, div.verseblock { |
| 185 | padding-left: 1.0em; |
| 186 | margin-left: 1.0em; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 187 | margin-right: 10%; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 188 | border-left: 5px solid #f0f0f0; |
| 189 | color: #888; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 190 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 191 | |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 192 | div.quoteblock > div.attribution { |
| 193 | padding-top: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 194 | text-align: right; |
| 195 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 196 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 197 | div.verseblock > pre.content { |
| 198 | font-family: inherit; |
| 199 | font-size: inherit; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 200 | } |
| 201 | div.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 Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 206 | div.verseblock + div.attribution { |
| 207 | text-align: left; |
| 208 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 209 | |
| 210 | div.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 | } |
| 218 | div.admonitionblock td.content { |
| 219 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 220 | border-left: 3px solid #dddddd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 221 | } |
| 222 | |
| 223 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 224 | border-left: 3px solid #dddddd; |
| 225 | padding-left: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 226 | } |
| 227 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 228 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 229 | span.image img { border-style: none; vertical-align: text-bottom; } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 230 | a.image:visited { color: white; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 231 | |
| 232 | dl { |
| 233 | margin-top: 0.8em; |
| 234 | margin-bottom: 0.8em; |
| 235 | } |
| 236 | dt { |
| 237 | margin-top: 0.5em; |
| 238 | margin-bottom: 0; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 239 | font-style: normal; |
| 240 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 241 | } |
| 242 | dd > *:first-child { |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 243 | margin-top: 0.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 244 | } |
| 245 | |
| 246 | ul, ol { |
| 247 | list-style-position: outside; |
| 248 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 249 | ol.arabic { |
| 250 | list-style-type: decimal; |
| 251 | } |
| 252 | ol.loweralpha { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 253 | list-style-type: lower-alpha; |
| 254 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 255 | ol.upperalpha { |
| 256 | list-style-type: upper-alpha; |
| 257 | } |
| 258 | ol.lowerroman { |
| 259 | list-style-type: lower-roman; |
| 260 | } |
| 261 | ol.upperroman { |
| 262 | list-style-type: upper-roman; |
| 263 | } |
| 264 | |
| 265 | div.compact ul, div.compact ol, |
| 266 | div.compact p, div.compact p, |
| 267 | div.compact div, div.compact div { |
| 268 | margin-top: 0.1em; |
| 269 | margin-bottom: 0.1em; |
| 270 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 271 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 272 | tfoot { |
| 273 | font-weight: bold; |
| 274 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 275 | td > div.verse { |
| 276 | white-space: pre; |
| 277 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 278 | |
| 279 | div.hdlist { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 280 | margin-top: 0.8em; |
| 281 | margin-bottom: 0.8em; |
| 282 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 283 | div.hdlist tr { |
| 284 | padding-bottom: 15px; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 285 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 286 | dt.hdlist1.strong, td.hdlist1.strong { |
| 287 | font-weight: bold; |
| 288 | } |
| 289 | td.hdlist1 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 290 | vertical-align: top; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 291 | font-style: normal; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 292 | padding-right: 0.8em; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 293 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 294 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 295 | td.hdlist2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 296 | vertical-align: top; |
| 297 | } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 298 | div.hdlist.compact tr { |
| 299 | margin: 0; |
| 300 | padding-bottom: 0; |
| 301 | } |
| 302 | |
| 303 | .comment { |
| 304 | background: yellow; |
| 305 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 306 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 307 | .footnote, .footnoteref { |
| 308 | font-size: 0.8em; |
| 309 | } |
| 310 | |
| 311 | span.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 Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 334 | div.colist td { |
| 335 | padding-right: 0.5em; |
| 336 | padding-bottom: 0.3em; |
| 337 | vertical-align: top; |
| 338 | } |
| 339 | div.colist td img { |
| 340 | margin-top: 0.3em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 341 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 342 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 343 | @media print { |
| 344 | #footer-badges { display: none; } |
| 345 | } |
| 346 | |
| 347 | #toc { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 348 | margin-bottom: 2.5em; |
| 349 | } |
| 350 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 351 | #toctitle { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 352 | color: #527bbd; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 353 | font-size: 1.1em; |
| 354 | font-weight: bold; |
| 355 | margin-top: 1.0em; |
| 356 | margin-bottom: 0.1em; |
| 357 | } |
| 358 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 359 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 360 | margin-top: 0; |
| 361 | margin-bottom: 0; |
| 362 | } |
| 363 | div.toclevel2 { |
| 364 | margin-left: 2em; |
| 365 | font-size: 0.9em; |
| 366 | } |
| 367 | div.toclevel3 { |
| 368 | margin-left: 4em; |
| 369 | font-size: 0.9em; |
| 370 | } |
| 371 | div.toclevel4 { |
| 372 | margin-left: 6em; |
| 373 | font-size: 0.9em; |
| 374 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 375 | |
| 376 | span.aqua { color: aqua; } |
| 377 | span.black { color: black; } |
| 378 | span.blue { color: blue; } |
| 379 | span.fuchsia { color: fuchsia; } |
| 380 | span.gray { color: gray; } |
| 381 | span.green { color: green; } |
| 382 | span.lime { color: lime; } |
| 383 | span.maroon { color: maroon; } |
| 384 | span.navy { color: navy; } |
| 385 | span.olive { color: olive; } |
| 386 | span.purple { color: purple; } |
| 387 | span.red { color: red; } |
| 388 | span.silver { color: silver; } |
| 389 | span.teal { color: teal; } |
| 390 | span.white { color: white; } |
| 391 | span.yellow { color: yellow; } |
| 392 | |
| 393 | span.aqua-background { background: aqua; } |
| 394 | span.black-background { background: black; } |
| 395 | span.blue-background { background: blue; } |
| 396 | span.fuchsia-background { background: fuchsia; } |
| 397 | span.gray-background { background: gray; } |
| 398 | span.green-background { background: green; } |
| 399 | span.lime-background { background: lime; } |
| 400 | span.maroon-background { background: maroon; } |
| 401 | span.navy-background { background: navy; } |
| 402 | span.olive-background { background: olive; } |
| 403 | span.purple-background { background: purple; } |
| 404 | span.red-background { background: red; } |
| 405 | span.silver-background { background: silver; } |
| 406 | span.teal-background { background: teal; } |
| 407 | span.white-background { background: white; } |
| 408 | span.yellow-background { background: yellow; } |
| 409 | |
| 410 | span.big { font-size: 2em; } |
| 411 | span.small { font-size: 0.6em; } |
| 412 | |
| 413 | span.underline { text-decoration: underline; } |
| 414 | span.overline { text-decoration: overline; } |
| 415 | span.line-through { text-decoration: line-through; } |
| 416 | |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 417 | div.unbreakable { page-break-inside: avoid; } |
| 418 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 419 | |
| 420 | /* |
| 421 | * xhtml11 specific |
| 422 | * |
| 423 | * */ |
| 424 | |
| 425 | div.tableblock { |
| 426 | margin-top: 1.0em; |
| 427 | margin-bottom: 1.5em; |
| 428 | } |
| 429 | div.tableblock > table { |
| 430 | border: 3px solid #527bbd; |
| 431 | } |
| 432 | thead, p.table.header { |
| 433 | font-weight: bold; |
| 434 | color: #527bbd; |
| 435 | } |
| 436 | p.table { |
| 437 | margin-top: 0; |
| 438 | } |
Junio C Hamano | 725b0da | 2020-01-22 22:02:40 | [diff] [blame] | 439 | /* Because the table frame attribute is overridden by CSS in most browsers. */ |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 440 | div.tableblock > table[frame="void"] { |
| 441 | border-style: none; |
| 442 | } |
| 443 | div.tableblock > table[frame="hsides"] { |
| 444 | border-left-style: none; |
| 445 | border-right-style: none; |
| 446 | } |
| 447 | div.tableblock > table[frame="vsides"] { |
| 448 | border-top-style: none; |
| 449 | border-bottom-style: none; |
| 450 | } |
| 451 | |
| 452 | |
| 453 | /* |
| 454 | * html5 specific |
| 455 | * |
| 456 | * */ |
| 457 | |
| 458 | table.tableblock { |
| 459 | margin-top: 1.0em; |
| 460 | margin-bottom: 1.5em; |
| 461 | } |
| 462 | thead, p.tableblock.header { |
| 463 | font-weight: bold; |
| 464 | color: #527bbd; |
| 465 | } |
| 466 | p.tableblock { |
| 467 | margin-top: 0; |
| 468 | } |
| 469 | table.tableblock { |
| 470 | border-width: 3px; |
| 471 | border-spacing: 0px; |
| 472 | border-style: solid; |
| 473 | border-color: #527bbd; |
| 474 | border-collapse: collapse; |
| 475 | } |
| 476 | th.tableblock, td.tableblock { |
| 477 | border-width: 1px; |
| 478 | padding: 4px; |
| 479 | border-style: solid; |
| 480 | border-color: #527bbd; |
| 481 | } |
| 482 | |
| 483 | table.tableblock.frame-topbot { |
| 484 | border-left-style: hidden; |
| 485 | border-right-style: hidden; |
| 486 | } |
| 487 | table.tableblock.frame-sides { |
| 488 | border-top-style: hidden; |
| 489 | border-bottom-style: hidden; |
| 490 | } |
| 491 | table.tableblock.frame-none { |
| 492 | border-style: hidden; |
| 493 | } |
| 494 | |
| 495 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 496 | text-align: left; |
| 497 | } |
| 498 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 499 | text-align: center; |
| 500 | } |
| 501 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 502 | text-align: right; |
| 503 | } |
| 504 | |
| 505 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 506 | vertical-align: top; |
| 507 | } |
| 508 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 509 | vertical-align: middle; |
| 510 | } |
| 511 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 512 | vertical-align: bottom; |
| 513 | } |
| 514 | |
| 515 | |
| 516 | /* |
| 517 | * manpage specific |
| 518 | * |
| 519 | * */ |
| 520 | |
| 521 | body.manpage h1 { |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 522 | padding-top: 0.5em; |
| 523 | padding-bottom: 0.5em; |
| 524 | border-top: 2px solid silver; |
| 525 | border-bottom: 2px solid silver; |
| 526 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 527 | body.manpage h2 { |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 528 | border-style: none; |
| 529 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 530 | body.manpage div.sectionbody { |
| 531 | margin-left: 3em; |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 532 | } |
| 533 | |
| 534 | @media print { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 535 | body.manpage div#toc { display: none; } |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 536 | } |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 537 | |
| 538 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 539 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 540 | <script type="text/javascript"> |
| 541 | /*<![CDATA[*/ |
Junio C Hamano | 2b15318 | 2021-12-15 21:00:31 | [diff] [blame] | 542 | var 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. |
| 562 | toc: 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 | |
| 648 | footnotes: 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 | |
| 708 | install: 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 Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 731 | asciidoc.install(); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 732 | /*]]>*/ |
| 733 | </script> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 734 | </head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 735 | <body class="manpage"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 736 | <div id="header"> |
| 737 | <h1> |
| 738 | git-commit(1) Manual Page |
| 739 | </h1> |
| 740 | <h2>NAME</h2> |
| 741 | <div class="sectionbody"> |
| 742 | <p>git-commit - |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 743 | Record changes to the repository |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 744 | </p> |
| 745 | </div> |
| 746 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 747 | <div id="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 748 | <div class="sect1"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 749 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 750 | <div class="sectionbody"> |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 751 | <div class="verseblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 752 | <pre class="content"><em>git commit</em> [-a | --interactive | --patch] [-s] [-v] [-u<mode>] [--amend] |
Junio C Hamano | aae21c9 | 2021-03-26 22:47:14 | [diff] [blame] | 753 | [--dry-run] [(-c | -C | --squash) <commit> | --fixup [(amend|reword):]<commit>)] |
Junio C Hamano | 3d050d6 | 2011-05-17 06:43:34 | [diff] [blame] | 754 | [-F <file> | -m <msg>] [--reset-author] [--allow-empty] |
| 755 | [--allow-empty-message] [--no-verify] [-e] [--author=<author>] |
Junio C Hamano | 3d1b5a1 | 2013-05-17 23:34:02 | [diff] [blame] | 756 | [--date=<date>] [--cleanup=<mode>] [--[no-]status] |
Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 757 | [-i | -o] [--pathspec-from-file=<file> [--pathspec-file-nul]] |
Junio C Hamano | 69bbb1f | 2021-04-08 00:21:04 | [diff] [blame] | 758 | [(--trailer <token>[(=|:)<value>])…] [-S[<keyid>]] |
| 759 | [--] [<pathspec>…]</pre> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 760 | <div class="attribution"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 761 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 762 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 763 | </div> |
| 764 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 765 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 766 | <div class="sectionbody"> |
Junio C Hamano | 23168ef | 2019-02-07 07:20:47 | [diff] [blame] | 767 | <div class="paragraph"><p>Create a new commit containing the current contents of the index and |
| 768 | the given log message describing the changes. The new commit is a |
| 769 | direct child of HEAD, usually the tip of the current branch, and the |
| 770 | branch is updated to point to it (unless no branch is associated with |
| 771 | the 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 Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 774 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 775 | <li> |
| 776 | <p> |
Junio C Hamano | 23168ef | 2019-02-07 07:20:47 | [diff] [blame] | 777 | by 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 Hamano | b515b6a | 2007-08-08 09:21:16 | [diff] [blame] | 780 | </p> |
| 781 | </li> |
| 782 | <li> |
| 783 | <p> |
Junio C Hamano | 23168ef | 2019-02-07 07:20:47 | [diff] [blame] | 784 | by using <a href="git-rm.html">git-rm(1)</a> to remove files from the working tree |
Junio C Hamano | bd2b4bb | 2007-08-06 06:42:24 | [diff] [blame] | 785 | and the index, again before using the <em>commit</em> command; |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 786 | </p> |
| 787 | </li> |
| 788 | <li> |
| 789 | <p> |
Junio C Hamano | c0859f7 | 2016-10-17 22:22:57 | [diff] [blame] | 790 | by listing files as arguments to the <em>commit</em> command |
| 791 | (without --interactive or --patch switch), in which |
Junio C Hamano | bd2b4bb | 2007-08-06 06:42:24 | [diff] [blame] | 792 | case the commit will ignore changes staged in the index, and instead |
Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 793 | record the current content of the listed files (which must already |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 794 | be known to Git); |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 795 | </p> |
| 796 | </li> |
| 797 | <li> |
| 798 | <p> |
Junio C Hamano | bd2b4bb | 2007-08-06 06:42:24 | [diff] [blame] | 799 | by 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 Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 804 | </p> |
| 805 | </li> |
Junio C Hamano | c51fede | 2007-03-12 07:29:20 | [diff] [blame] | 806 | <li> |
| 807 | <p> |
Junio C Hamano | 3d050d6 | 2011-05-17 06:43:34 | [diff] [blame] | 808 | by using the --interactive or --patch switches with the <em>commit</em> command |
Junio C Hamano | c0859f7 | 2016-10-17 22:22:57 | [diff] [blame] | 809 | 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 Hamano | b76a686 | 2012-05-02 22:02:46 | [diff] [blame] | 811 | before finalizing the operation. See the “Interactive Mode” section of |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 812 | <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] | 813 | </p> |
| 814 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 815 | </ol></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 816 | <div class="paragraph"><p>The <code>--dry-run</code> option can be used to obtain a |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 817 | 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] | 818 | 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] | 819 | <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] | 820 | 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] | 821 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 822 | </div> |
| 823 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 824 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 825 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 826 | <div class="dlist"><dl> |
| 827 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 828 | -a |
| 829 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 830 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 831 | --all |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 832 | </dt> |
| 833 | <dd> |
| 834 | <p> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 835 | Tell the command to automatically stage files that have |
| 836 | been modified and deleted, but new files you have not |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 837 | told Git about are not affected. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 838 | </p> |
| 839 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 840 | <dt class="hdlist1"> |
Junio C Hamano | 3d050d6 | 2011-05-17 06:43:34 | [diff] [blame] | 841 | -p |
| 842 | </dt> |
| 843 | <dt class="hdlist1"> |
| 844 | --patch |
| 845 | </dt> |
| 846 | <dd> |
| 847 | <p> |
Junio C Hamano | 91a411f | 2021-07-14 00:40:50 | [diff] [blame] | 848 | Use the interactive patch selection interface to choose |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 849 | which changes to commit. See <a href="git-add.html">git-add(1)</a> for |
Junio C Hamano | 3d050d6 | 2011-05-17 06:43:34 | [diff] [blame] | 850 | details. |
| 851 | </p> |
| 852 | </dd> |
| 853 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 854 | -C <commit> |
| 855 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 856 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 857 | --reuse-message=<commit> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 858 | </dt> |
| 859 | <dd> |
| 860 | <p> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 861 | Take an existing commit object, and reuse the log message |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 862 | and the authorship information (including the timestamp) |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 863 | when creating the commit. |
| 864 | </p> |
| 865 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 866 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 867 | -c <commit> |
| 868 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 869 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 870 | --reedit-message=<commit> |
| 871 | </dt> |
| 872 | <dd> |
| 873 | <p> |
Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 874 | Like <em>-C</em>, but with <code>-c</code> the editor is invoked, so that |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 875 | the user can further edit the commit message. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 876 | </p> |
| 877 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 878 | <dt class="hdlist1"> |
Junio C Hamano | aae21c9 | 2021-03-26 22:47:14 | [diff] [blame] | 879 | --fixup=[(amend|reword):]<commit> |
Junio C Hamano | 2e6ded8 | 2010-12-05 06:20:48 | [diff] [blame] | 880 | </dt> |
| 881 | <dd> |
| 882 | <p> |
Junio C Hamano | aae21c9 | 2021-03-26 22:47:14 | [diff] [blame] | 883 | Create a new commit which "fixes up" <code><commit></code> when applied with |
| 884 | <code>git rebase --autosquash</code>. Plain <code>--fixup=<commit></code> creates a |
| 885 | "fixup!" commit which changes the content of <code><commit></code> but leaves |
| 886 | its log message untouched. <code>--fixup=amend:<commit></code> is similar but |
| 887 | creates an "amend!" commit which also replaces the log message of |
| 888 | <code><commit></code> with the log message of the "amend!" commit. |
| 889 | <code>--fixup=reword:<commit></code> creates an "amend!" commit which |
| 890 | replaces the log message of <code><commit></code> with its own log message |
| 891 | but makes no changes to the content of <code><commit></code>. |
Junio C Hamano | 2e6ded8 | 2010-12-05 06:20:48 | [diff] [blame] | 892 | </p> |
Junio C Hamano | aae21c9 | 2021-03-26 22:47:14 | [diff] [blame] | 893 | <div class="paragraph"><p>The commit created by plain <code>--fixup=<commit></code> has a subject |
| 894 | composed of "fixup!" followed by the subject line from <commit>, |
| 895 | and is recognized specially by <code>git rebase --autosquash</code>. The <code>-m</code> |
| 896 | option may be used to supplement the log message of the created |
| 897 | commit, but the additional commentary will be thrown away once the |
| 898 | "fixup!" commit is squashed into <code><commit></code> by |
| 899 | <code>git rebase --autosquash</code>.</p></div> |
| 900 | <div class="paragraph"><p>The commit created by <code>--fixup=amend:<commit></code> is similar but its |
| 901 | subject is instead prefixed with "amend!". The log message of |
| 902 | <commit> is copied into the log message of the "amend!" commit and |
| 903 | opened in an editor so it can be refined. When <code>git rebase |
| 904 | --autosquash</code> squashes the "amend!" commit into <code><commit></code>, the |
| 905 | log message of <code><commit></code> is replaced by the refined log message |
| 906 | from the "amend!" commit. It is an error for the "amend!" commit’s |
| 907 | log message to be empty unless <code>--allow-empty-message</code> is |
| 908 | specified.</p></div> |
| 909 | <div class="paragraph"><p><code>--fixup=reword:<commit></code> is shorthand for <code>--fixup=amend:<commit> |
| 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 |
| 912 | rebase --autosquash</code>, it replaces the log message of <code><commit></code> |
| 913 | without making any other changes.</p></div> |
| 914 | <div class="paragraph"><p>Neither "fixup!" nor "amend!" commits change authorship of |
| 915 | <code><commit></code> when applied by <code>git rebase --autosquash</code>. |
| 916 | See <a href="git-rebase.html">git-rebase(1)</a> for details.</p></div> |
Junio C Hamano | 2e6ded8 | 2010-12-05 06:20:48 | [diff] [blame] | 917 | </dd> |
| 918 | <dt class="hdlist1"> |
| 919 | --squash=<commit> |
| 920 | </dt> |
| 921 | <dd> |
| 922 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 923 | Construct a commit message for use with <code>rebase --autosquash</code>. |
Junio C Hamano | 2e6ded8 | 2010-12-05 06:20:48 | [diff] [blame] | 924 | The commit message subject line is taken from the specified |
| 925 | commit with a prefix of "squash! ". Can be used with additional |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 926 | commit message options (<code>-m</code>/<code>-c</code>/<code>-C</code>/<code>-F</code>). See |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 927 | <a href="git-rebase.html">git-rebase(1)</a> for details. |
Junio C Hamano | 2e6ded8 | 2010-12-05 06:20:48 | [diff] [blame] | 928 | </p> |
| 929 | </dd> |
| 930 | <dt class="hdlist1"> |
Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 931 | --reset-author |
| 932 | </dt> |
| 933 | <dd> |
| 934 | <p> |
Junio C Hamano | a8cc1d8 | 2011-03-10 01:18:12 | [diff] [blame] | 935 | When used with -C/-c/--amend options, or when committing after a |
Junio C Hamano | 4c60d9a | 2017-05-04 14:36:22 | [diff] [blame] | 936 | conflicting cherry-pick, declare that the authorship of the |
Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 937 | resulting commit now belongs to the committer. This also renews |
Junio C Hamano | a8cc1d8 | 2011-03-10 01:18:12 | [diff] [blame] | 938 | the author timestamp. |
Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 939 | </p> |
| 940 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 941 | <dt class="hdlist1"> |
Junio C Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 942 | --short |
| 943 | </dt> |
| 944 | <dd> |
| 945 | <p> |
| 946 | When doing a dry-run, give the output in the short-format. See |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 947 | <a href="git-status.html">git-status(1)</a> for details. Implies <code>--dry-run</code>. |
Junio C Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 948 | </p> |
| 949 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 950 | <dt class="hdlist1"> |
Junio C Hamano | 9257a33 | 2012-06-25 20:01:02 | [diff] [blame] | 951 | --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 Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 959 | --porcelain |
| 960 | </dt> |
| 961 | <dd> |
| 962 | <p> |
| 963 | When doing a dry-run, give the output in a porcelain-ready |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 964 | format. See <a href="git-status.html">git-status(1)</a> for details. Implies |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 965 | <code>--dry-run</code>. |
Junio C Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 966 | </p> |
| 967 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 968 | <dt class="hdlist1"> |
Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 969 | --long |
| 970 | </dt> |
| 971 | <dd> |
| 972 | <p> |
Junio C Hamano | 4c60d9a | 2017-05-04 14:36:22 | [diff] [blame] | 973 | When doing a dry-run, give the output in the long-format. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 974 | Implies <code>--dry-run</code>. |
Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 975 | </p> |
| 976 | </dd> |
| 977 | <dt class="hdlist1"> |
Junio C Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 978 | -z |
| 979 | </dt> |
Junio C Hamano | 9257a33 | 2012-06-25 20:01:02 | [diff] [blame] | 980 | <dt class="hdlist1"> |
| 981 | --null |
| 982 | </dt> |
Junio C Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 983 | <dd> |
| 984 | <p> |
Junio C Hamano | 0f6f3bf | 2017-03-13 07:01:53 | [diff] [blame] | 985 | 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 Hamano | a0fae26 | 2009-12-28 09:33:50 | [diff] [blame] | 991 | </p> |
| 992 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 993 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 994 | -F <file> |
| 995 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 996 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 997 | --file=<file> |
| 998 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 999 | <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 Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1005 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1006 | --author=<author> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1007 | </dt> |
| 1008 | <dd> |
| 1009 | <p> |
Junio C Hamano | 13002fb | 2010-06-08 05:53:58 | [diff] [blame] | 1010 | Override the commit author. Specify an explicit author using the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1011 | standard <code>A U Thor <author@example.com></code> format. Otherwise <author> |
Junio C Hamano | 13002fb | 2010-06-08 05:53:58 | [diff] [blame] | 1012 | 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=<author>); |
| 1014 | the commit author is then copied from the first such commit found. |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [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 | ae05fee | 2010-01-08 07:39:46 | [diff] [blame] | 1018 | --date=<date> |
| 1019 | </dt> |
| 1020 | <dd> |
| 1021 | <p> |
| 1022 | Override the author date used in the commit. |
| 1023 | </p> |
| 1024 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1025 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1026 | -m <msg> |
| 1027 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1028 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1029 | --message=<msg> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1030 | </dt> |
| 1031 | <dd> |
| 1032 | <p> |
| 1033 | Use the given <msg> as the commit message. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1034 | If multiple <code>-m</code> options are given, their values are |
Junio C Hamano | 09cfe6f | 2013-03-27 22:10:42 | [diff] [blame] | 1035 | concatenated as separate paragraphs. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1036 | </p> |
Junio C Hamano | 7b9cce9 | 2018-01-23 22:34:27 | [diff] [blame] | 1037 | <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 Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1038 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1039 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1040 | -t <file> |
| 1041 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1042 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1043 | --template=<file> |
Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 1044 | </dt> |
| 1045 | <dd> |
| 1046 | <p> |
Junio C Hamano | 51f87de | 2012-04-16 21:18:54 | [diff] [blame] | 1047 | When editing the commit message, start the editor with the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1048 | contents in the given file. The <code>commit.template</code> configuration |
Junio C Hamano | 51f87de | 2012-04-16 21:18:54 | [diff] [blame] | 1049 | 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 Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1054 | is given by other means, e.g. with the <code>-m</code> or <code>-F</code> options. |
Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 1055 | </p> |
| 1056 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1057 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1058 | -s |
| 1059 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1060 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1061 | --signoff |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1062 | </dt> |
Junio C Hamano | df3d3cd | 2020-11-02 22:05:05 | [diff] [blame] | 1063 | <dt class="hdlist1"> |
| 1064 | --no-signoff |
| 1065 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1066 | <dd> |
| 1067 | <p> |
Junio C Hamano | df3d3cd | 2020-11-02 22:05:05 | [diff] [blame] | 1068 | 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’re committing. For example, it may certify that |
| 1071 | the committer has the rights to submit the work under the |
| 1072 | project’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’re contributing to |
| 1077 | understand how the signoffs are used in that project. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1078 | </p> |
Junio C Hamano | df3d3cd | 2020-11-02 22:05:05 | [diff] [blame] | 1079 | <div class="paragraph"><p>The --no-signoff option can be used to countermand an earlier --signoff |
| 1080 | option on the command line.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1081 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1082 | <dt class="hdlist1"> |
Junio C Hamano | 69bbb1f | 2021-04-08 00:21:04 | [diff] [blame] | 1083 | --trailer <token>[(=|:)<value>] |
| 1084 | </dt> |
| 1085 | <dd> |
| 1086 | <p> |
| 1087 | Specify a (<token>, <value>) pair that should be applied as a |
| 1088 | trailer. (e.g. <code>git commit --trailer "Signed-off-by:C O Mitter \ |
| 1089 | <committer@example.com>" --trailer "Helped-by:C O Mitter \ |
| 1090 | <committer@example.com>"</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 Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1099 | -n |
| 1100 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1101 | <dt class="hdlist1"> |
Junio C Hamano | 5dbbd5d | 2021-11-04 20:22:31 | [diff] [blame] | 1102 | --[no-]verify |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1103 | </dt> |
| 1104 | <dd> |
| 1105 | <p> |
Junio C Hamano | 5dbbd5d | 2021-11-04 20:22:31 | [diff] [blame] | 1106 | 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 Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1108 | See also <a href="githooks.html">githooks(5)</a>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1109 | </p> |
| 1110 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1111 | <dt class="hdlist1"> |
Junio C Hamano | 0c99970 | 2007-12-03 09:57:55 | [diff] [blame] | 1112 | --allow-empty |
| 1113 | </dt> |
| 1114 | <dd> |
| 1115 | <p> |
| 1116 | Usually recording a commit that has the exact same tree as its |
Junio C Hamano | 5825687 | 2007-12-04 08:31:13 | [diff] [blame] | 1117 | 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 Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1119 | is primarily for use by foreign SCM interface scripts. |
Junio C Hamano | 0c99970 | 2007-12-03 09:57:55 | [diff] [blame] | 1120 | </p> |
| 1121 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1122 | <dt class="hdlist1"> |
Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 1123 | --allow-empty-message |
| 1124 | </dt> |
| 1125 | <dd> |
| 1126 | <p> |
| 1127 | Like --allow-empty this command is primarily for use by foreign |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1128 | SCM interface scripts. It allows you to create a commit with an |
Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 1129 | empty commit message without using plumbing commands like |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1130 | <a href="git-commit-tree.html">git-commit-tree(1)</a>. |
Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 1131 | </p> |
| 1132 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1133 | <dt class="hdlist1"> |
Junio C Hamano | 554da79 | 2007-12-27 03:29:58 | [diff] [blame] | 1134 | --cleanup=<mode> |
| 1135 | </dt> |
| 1136 | <dd> |
| 1137 | <p> |
Junio C Hamano | 5e7f131 | 2013-03-21 22:49:01 | [diff] [blame] | 1138 | This option determines how the supplied commit message should be |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1139 | cleaned up before committing. The <em><mode></em> can be <code>strip</code>, |
| 1140 | <code>whitespace</code>, <code>verbatim</code>, <code>scissors</code> or <code>default</code>. |
Junio C Hamano | 554da79 | 2007-12-27 03:29:58 | [diff] [blame] | 1141 | </p> |
Junio C Hamano | 5e7f131 | 2013-03-21 22:49:01 | [diff] [blame] | 1142 | <div class="openblock"> |
| 1143 | <div class="content"> |
| 1144 | <div class="dlist"><dl> |
| 1145 | <dt class="hdlist1"> |
| 1146 | strip |
| 1147 | </dt> |
| 1148 | <dd> |
| 1149 | <p> |
Junio C Hamano | e1b2859 | 2015-05-19 21:26:17 | [diff] [blame] | 1150 | Strip leading and trailing empty lines, trailing whitespace, |
| 1151 | commentary and collapse consecutive empty lines. |
Junio C Hamano | 5e7f131 | 2013-03-21 22:49:01 | [diff] [blame] | 1152 | </p> |
| 1153 | </dd> |
| 1154 | <dt class="hdlist1"> |
| 1155 | whitespace |
| 1156 | </dt> |
| 1157 | <dd> |
| 1158 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1159 | Same as <code>strip</code> except #commentary is not removed. |
Junio C Hamano | 5e7f131 | 2013-03-21 22:49:01 | [diff] [blame] | 1160 | </p> |
| 1161 | </dd> |
| 1162 | <dt class="hdlist1"> |
| 1163 | verbatim |
| 1164 | </dt> |
| 1165 | <dd> |
| 1166 | <p> |
| 1167 | Do not change the message at all. |
| 1168 | </p> |
| 1169 | </dd> |
| 1170 | <dt class="hdlist1"> |
Junio C Hamano | 3214e5f | 2014-03-25 19:54:38 | [diff] [blame] | 1171 | scissors |
| 1172 | </dt> |
| 1173 | <dd> |
| 1174 | <p> |
Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 1175 | 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 Hamano | 3214e5f | 2014-03-25 19:54:38 | [diff] [blame] | 1178 | </p> |
Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 1179 | <div class="literalblock"> |
| 1180 | <div class="content"> |
| 1181 | <pre><code># ------------------------ >8 ------------------------</code></pre> |
| 1182 | </div></div> |
Junio C Hamano | 3214e5f | 2014-03-25 19:54:38 | [diff] [blame] | 1183 | </dd> |
| 1184 | <dt class="hdlist1"> |
Junio C Hamano | 5e7f131 | 2013-03-21 22:49:01 | [diff] [blame] | 1185 | default |
| 1186 | </dt> |
| 1187 | <dd> |
| 1188 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1189 | Same as <code>strip</code> if the message is to be edited. |
| 1190 | Otherwise <code>whitespace</code>. |
Junio C Hamano | 5e7f131 | 2013-03-21 22:49:01 | [diff] [blame] | 1191 | </p> |
| 1192 | </dd> |
| 1193 | </dl></div> |
| 1194 | </div></div> |
Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 1195 | <div class="paragraph"><p>The default can be changed by the <code>commit.cleanup</code> configuration |
Junio C Hamano | 5e7f131 | 2013-03-21 22:49:01 | [diff] [blame] | 1196 | variable (see <a href="git-config.html">git-config(1)</a>).</p></div> |
Junio C Hamano | 554da79 | 2007-12-27 03:29:58 | [diff] [blame] | 1197 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1198 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1199 | -e |
| 1200 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1201 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1202 | --edit |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1203 | </dt> |
| 1204 | <dd> |
| 1205 | <p> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1206 | 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 Hamano | c097e56 | 2013-05-03 23:06:12 | [diff] [blame] | 1208 | the commit log message unmodified. This option lets you |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1209 | further edit the message taken from these sources. |
| 1210 | </p> |
| 1211 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1212 | <dt class="hdlist1"> |
Junio C Hamano | 4eb2b9c | 2012-11-15 21:12:29 | [diff] [blame] | 1213 | --no-edit |
| 1214 | </dt> |
| 1215 | <dd> |
| 1216 | <p> |
| 1217 | Use the selected commit message without launching an editor. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1218 | For example, <code>git commit --amend --no-edit</code> amends a commit |
Junio C Hamano | 4eb2b9c | 2012-11-15 21:12:29 | [diff] [blame] | 1219 | without changing its commit message. |
| 1220 | </p> |
| 1221 | </dd> |
| 1222 | <dt class="hdlist1"> |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 1223 | --amend |
| 1224 | </dt> |
| 1225 | <dd> |
| 1226 | <p> |
Junio C Hamano | 63b6fdb | 2013-04-07 23:37:13 | [diff] [blame] | 1227 | Replace the tip of the current branch by creating a new |
| 1228 | commit. The recorded tree is prepared as usual (including |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1229 | the effect of the <code>-i</code> and <code>-o</code> options and explicit |
Junio C Hamano | 63b6fdb | 2013-04-07 23:37:13 | [diff] [blame] | 1230 | 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 Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1233 | 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 Hamano | 63b6fdb | 2013-04-07 23:37:13 | [diff] [blame] | 1235 | option can countermand this). |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 1236 | </p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1237 | <div class="openblock"> |
| 1238 | <div class="content"> |
Junio C Hamano | 4eb2b9c | 2012-11-15 21:12:29 | [diff] [blame] | 1239 | <div class="paragraph"><p>It is a rough equivalent for:</p></div> |
| 1240 | <div class="listingblock"> |
| 1241 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1242 | <pre><code> $ git reset --soft HEAD^ |
Junio C Hamano | 4eb2b9c | 2012-11-15 21:12:29 | [diff] [blame] | 1243 | $ ... do something else to come up with the right tree ... |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1244 | $ git commit -c ORIG_HEAD</code></pre> |
Junio C Hamano | 4eb2b9c | 2012-11-15 21:12:29 | [diff] [blame] | 1245 | </div></div> |
| 1246 | <div class="paragraph"><p>but can be used to amend a merge commit.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1247 | </div></div> |
Junio C Hamano | 4eb2b9c | 2012-11-15 21:12:29 | [diff] [blame] | 1248 | <div class="paragraph"><p>You should understand the implications of rewriting history if you |
| 1249 | amend a commit that has already been published. (See the "RECOVERING |
| 1250 | FROM UPSTREAM REBASE" section in <a href="git-rebase.html">git-rebase(1)</a>.)</p></div> |
Junio C Hamano | 9257a33 | 2012-06-25 20:01:02 | [diff] [blame] | 1251 | </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 Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1260 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1261 | -i |
| 1262 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1263 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1264 | --include |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1265 | </dt> |
| 1266 | <dd> |
| 1267 | <p> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1268 | 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 Hamano | 6697ac5 | 2006-02-14 08:00:23 | [diff] [blame] | 1272 | </p> |
| 1273 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1274 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1275 | -o |
| 1276 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1277 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1278 | --only |
Junio C Hamano | e79159d | 2008-04-12 08:23:17 | [diff] [blame] | 1279 | </dt> |
| 1280 | <dd> |
| 1281 | <p> |
Junio C Hamano | 19a0f4e | 2014-11-18 21:46:36 | [diff] [blame] | 1282 | Make a commit by taking the updated working tree contents |
| 1283 | of the paths specified on the |
Junio C Hamano | e79159d | 2008-04-12 08:23:17 | [diff] [blame] | 1284 | command line, disregarding any contents that have been |
Junio C Hamano | 19a0f4e | 2014-11-18 21:46:36 | [diff] [blame] | 1285 | staged for other paths. This is the default mode of operation of |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1286 | <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] | 1287 | in which case this option can be omitted. |
Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 1288 | If this option is specified together with <code>--amend</code>, then |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 1289 | no paths need to be specified, which can be used to amend |
Junio C Hamano | e79159d | 2008-04-12 08:23:17 | [diff] [blame] | 1290 | the last commit without committing changes that have |
Junio C Hamano | 52b1cfb | 2016-12-20 00:18:36 | [diff] [blame] | 1291 | 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 Hamano | e79159d | 2008-04-12 08:23:17 | [diff] [blame] | 1293 | </p> |
| 1294 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1295 | <dt class="hdlist1"> |
Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 1296 | --pathspec-from-file=<file> |
| 1297 | </dt> |
| 1298 | <dd> |
| 1299 | <p> |
| 1300 | Pathspec is passed in <code><file></code> instead of commandline args. If |
| 1301 | <code><file></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 Hamano | 4224f99 | 2008-06-23 07:14:08 | [diff] [blame] | 1319 | -u[<mode>] |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1320 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1321 | <dt class="hdlist1"> |
Junio C Hamano | 4224f99 | 2008-06-23 07:14:08 | [diff] [blame] | 1322 | --untracked-files[=<mode>] |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1323 | </dt> |
| 1324 | <dd> |
| 1325 | <p> |
Junio C Hamano | 36a4dbc | 2011-02-22 07:51:32 | [diff] [blame] | 1326 | Show untracked files. |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1327 | </p> |
Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 1328 | <div class="openblock"> |
| 1329 | <div class="content"> |
Junio C Hamano | 36a4dbc | 2011-02-22 07:51:32 | [diff] [blame] | 1330 | <div class="paragraph"><p>The mode parameter is optional (defaults to <em>all</em>), and is used to |
| 1331 | specify the handling of untracked files; when -u is not used, the |
| 1332 | 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] | 1333 | <div class="paragraph"><p>The possible options are:</p></div> |
| 1334 | <div class="ulist"><ul> |
Junio C Hamano | 4224f99 | 2008-06-23 07:14:08 | [diff] [blame] | 1335 | <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 Hamano | e1cca18 | 2010-02-20 20:01:23 | [diff] [blame] | 1349 | </li> |
| 1350 | </ul></div> |
Junio C Hamano | 48cd3f1 | 2019-10-09 05:55:30 | [diff] [blame] | 1351 | <div class="paragraph"><p>The default can be changed using the status.showUntrackedFiles |
| 1352 | configuration variable documented in <a href="git-config.html">git-config(1)</a>.</p></div> |
| 1353 | </div></div> |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1354 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1355 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1356 | -v |
| 1357 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1358 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1359 | --verbose |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1360 | </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 Hamano | e1b2859 | 2015-05-19 21:26:17 | [diff] [blame] | 1365 | template to help the user describe the commit by reminding |
| 1366 | what changes the commit has. |
| 1367 | Note that this diff output doesn’t have its |
| 1368 | lines prefixed with <em>#</em>. This diff will not be a part |
Junio C Hamano | f2a3a75 | 2016-05-23 22:54:39 | [diff] [blame] | 1369 | 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 Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1371 | </p> |
Junio C Hamano | 5992a25 | 2015-03-17 23:39:30 | [diff] [blame] | 1372 | <div class="paragraph"><p>If specified twice, show in addition the unified diff between |
| 1373 | what would be committed and the worktree files, i.e. the unstaged |
| 1374 | changes to tracked files.</p></div> |
Junio C Hamano | 1e6e006 | 2007-07-13 05:33:25 | [diff] [blame] | 1375 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1376 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1377 | -q |
| 1378 | </dt> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1379 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1380 | --quiet |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 1381 | </dt> |
| 1382 | <dd> |
| 1383 | <p> |
Junio C Hamano | f9771f6 | 2007-01-17 17:42:30 | [diff] [blame] | 1384 | Suppress commit summary message. |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 1385 | </p> |
| 1386 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1387 | <dt class="hdlist1"> |
Junio C Hamano | 1bb3199 | 2009-08-29 04:24:08 | [diff] [blame] | 1388 | --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 Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1397 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1398 | --status |
| 1399 | </dt> |
| 1400 | <dd> |
| 1401 | <p> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1402 | Include the output of <a href="git-status.html">git-status(1)</a> in the commit |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1403 | 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 Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1408 | <dt class="hdlist1"> |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1409 | --no-status |
| 1410 | </dt> |
| 1411 | <dd> |
| 1412 | <p> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1413 | Do not include the output of <a href="git-status.html">git-status(1)</a> in the |
Junio C Hamano | 6ce6b6c | 2010-01-18 01:25:50 | [diff] [blame] | 1414 | commit message template when using an editor to prepare the |
| 1415 | default commit message. |
| 1416 | </p> |
| 1417 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1418 | <dt class="hdlist1"> |
Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1419 | -S[<keyid>] |
| 1420 | </dt> |
| 1421 | <dt class="hdlist1"> |
| 1422 | --gpg-sign[=<keyid>] |
| 1423 | </dt> |
Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1424 | <dt class="hdlist1"> |
Junio C Hamano | 5b3533d | 2014-02-27 23:07:15 | [diff] [blame] | 1425 | --no-gpg-sign |
| 1426 | </dt> |
| 1427 | <dd> |
| 1428 | <p> |
Junio C Hamano | 67bf224 | 2020-04-22 21:41:44 | [diff] [blame] | 1429 | 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 Hamano | 5b3533d | 2014-02-27 23:07:15 | [diff] [blame] | 1434 | </p> |
| 1435 | </dd> |
| 1436 | <dt class="hdlist1"> |
Junio C Hamano | 1bb569e | 2006-05-05 23:14:25 | [diff] [blame] | 1437 | -- |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1438 | </dt> |
| 1439 | <dd> |
| 1440 | <p> |
| 1441 | Do not interpret any more arguments as options. |
| 1442 | </p> |
| 1443 | </dd> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1444 | <dt class="hdlist1"> |
Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 1445 | <pathspec>… |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1446 | </dt> |
| 1447 | <dd> |
| 1448 | <p> |
Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 1449 | 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 Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1453 | </p> |
Junio C Hamano | b489685 | 2019-12-10 23:15:09 | [diff] [blame] | 1454 | <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 Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1455 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1456 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1457 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1458 | </div> |
| 1459 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1460 | <h2 id="_examples">EXAMPLES</h2> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1461 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1462 | <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] | 1463 | your working tree are temporarily stored to a staging area |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1464 | called the "index" with <em>git add</em>. A file can be |
Junio C Hamano | 361c133 | 2007-11-14 12:17:22 | [diff] [blame] | 1465 | reverted back, only in the index but not in the working tree, |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 1466 | to that of the last commit with <code>git restore --staged <file></code>, |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1467 | which effectively reverts <em>git add</em> and prevents the changes to |
Junio C Hamano | 361c133 | 2007-11-14 12:17:22 | [diff] [blame] | 1468 | this file from participating in the next commit. After building |
| 1469 | the state to be committed incrementally with these commands, |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1470 | <code>git commit</code> (without any pathname parameter) is used to record what |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1471 | 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] | 1472 | command. An example:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1473 | <div class="listingblock"> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1474 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1475 | <pre><code>$ edit hello.c |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1476 | $ git rm goodbye.c |
| 1477 | $ git add hello.c |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1478 | $ git commit</code></pre> |
Junio C Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1479 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1480 | <div class="paragraph"><p>Instead of staging files after each individual change, you can |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1481 | tell <code>git commit</code> to notice the changes to the files whose |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1482 | contents are tracked in |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1483 | your working tree and do corresponding <code>git add</code> and <code>git rm</code> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1484 | for you. That is, this example does the same as the earlier |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1485 | 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] | 1486 | <div class="listingblock"> |
| 1487 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1488 | <pre><code>$ edit hello.c |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1489 | $ rm goodbye.c |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1490 | $ git commit -a</code></pre> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1491 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1492 | <div class="paragraph"><p>The command <code>git commit -a</code> first looks at your working tree, |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1493 | notices that you have modified hello.c and removed goodbye.c, |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1494 | and performs necessary <code>git add</code> and <code>git rm</code> for you.</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1495 | <div class="paragraph"><p>After staging changes to many files, you can alter the order the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1496 | changes are recorded in, by giving pathnames to <code>git commit</code>. |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1497 | When pathnames are given, the command makes a commit that |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1498 | only records the changes made to the named paths:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1499 | <div class="listingblock"> |
| 1500 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1501 | <pre><code>$ edit hello.c hello.h |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1502 | $ git add hello.c hello.h |
| 1503 | $ edit Makefile |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1504 | $ git commit Makefile</code></pre> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1505 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1506 | <div class="paragraph"><p>This makes a commit that records the modification to <code>Makefile</code>. |
| 1507 | The changes staged for <code>hello.c</code> and <code>hello.h</code> are not included |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1508 | 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] | 1509 | sequence, if you do:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1510 | <div class="listingblock"> |
| 1511 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1512 | <pre><code>$ git commit</code></pre> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1513 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1514 | <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 Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1516 | <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] | 1517 | because of conflicts, cleanly merged |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1518 | paths are already staged to be committed for you, and paths that |
| 1519 | conflicted are left in unmerged state. You would have to first |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1520 | check which paths are conflicting with <em>git status</em> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1521 | and after fixing them manually in your working tree, you would |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1522 | stage the result as usual with <em>git add</em>:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1523 | <div class="listingblock"> |
| 1524 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1525 | <pre><code>$ git status | grep unmerged |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1526 | unmerged: hello.c |
| 1527 | $ edit hello.c |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1528 | $ git add hello.c</code></pre> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1529 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1530 | <div class="paragraph"><p>After resolving conflicts and staging the result, <code>git ls-files -u</code> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1531 | would stop mentioning the conflicted path. When you are done, |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1532 | run <code>git commit</code> to finally record the merge:</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1533 | <div class="listingblock"> |
| 1534 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1535 | <pre><code>$ git commit</code></pre> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1536 | </div></div> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1537 | <div class="paragraph"><p>As with the case to record your own changes, you can use <code>-a</code> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1538 | option to save typing. One difference is that during a merge |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1539 | resolution, you cannot use <code>git commit</code> with pathnames to |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1540 | alter the order the changes are committed, because the merge |
| 1541 | should be recorded as a single commit. In fact, the command |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1542 | refuses to run when given pathnames (but see <code>-i</code> option).</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1543 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1544 | </div> |
| 1545 | <div class="sect1"> |
Junio C Hamano | bee061d | 2020-01-30 23:21:18 | [diff] [blame] | 1546 | <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 |
| 1549 | variables, if set:</p></div> |
| 1550 | <div class="literalblock"> |
| 1551 | <div class="content"> |
| 1552 | <pre><code>GIT_AUTHOR_NAME |
| 1553 | GIT_AUTHOR_EMAIL |
| 1554 | GIT_AUTHOR_DATE |
| 1555 | GIT_COMMITTER_NAME |
| 1556 | GIT_COMMITTER_EMAIL |
| 1557 | GIT_COMMITTER_DATE</code></pre> |
| 1558 | </div></div> |
| 1559 | <div class="paragraph"><p>(nb "<", ">" 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 |
| 1562 | enforce or require any particular form. Arbitrary Unicode may be used, subject |
| 1563 | to the constraints listed above. This name has no effect on authentication; for |
| 1564 | that, 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 |
| 1566 | is taken from the configuration items <code>user.name</code> and <code>user.email</code>, or, if not |
| 1567 | present, the environment variable EMAIL, or, if that is not set, |
| 1568 | system user name and the hostname used for outgoing mail (taken |
| 1569 | from <code>/etc/mailname</code> and falling back to the fully qualified hostname when |
| 1570 | that 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 |
| 1572 | override <code>user.name</code> and <code>user.email</code> if set and are overridden themselves by |
| 1573 | the 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; |
| 1575 | the 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 Hamano | a372d5b | 2021-02-26 01:34:37 | [diff] [blame] | 1581 | <div class="paragraph"><p>The <code>GIT_AUTHOR_DATE</code> and <code>GIT_COMMITTER_DATE</code> environment variables |
Junio C Hamano | bee061d | 2020-01-30 23:21:18 | [diff] [blame] | 1582 | support the following date formats:</p></div> |
| 1583 | <div class="dlist"><dl> |
| 1584 | <dt class="hdlist1"> |
| 1585 | Git internal format |
| 1586 | </dt> |
| 1587 | <dd> |
| 1588 | <p> |
Junio C Hamano | 59a32b0 | 2021-12-10 22:53:38 | [diff] [blame] | 1589 | It is <code><unix-timestamp> <time-zone-offset></code>, where |
| 1590 | <code><unix-timestamp></code> is the number of seconds since the UNIX epoch. |
| 1591 | <code><time-zone-offset></code> is a positive or negative offset from UTC. |
Junio C Hamano | bee061d | 2020-01-30 23:21:18 | [diff] [blame] | 1592 | For example CET (which is 1 hour ahead of UTC) is <code>+0100</code>. |
| 1593 | </p> |
| 1594 | </dd> |
| 1595 | <dt class="hdlist1"> |
| 1596 | RFC 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"> |
| 1605 | ISO 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 Hamano | dd4c178 | 2020-05-05 22:34:54 | [diff] [blame] | 1611 | <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 Hamano | 0beab6c | 2020-05-26 18:32:25 | [diff] [blame] | 1613 | <code>2005-04-07T22:13:13</code>. |
Junio C Hamano | bee061d | 2020-01-30 23:21:18 | [diff] [blame] | 1614 | </p> |
Junio C Hamano | 0beab6c | 2020-05-26 18:32:25 | [diff] [blame] | 1615 | <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 Hamano | bee061d | 2020-01-30 23:21:18 | [diff] [blame] | 1624 | </dd> |
| 1625 | </dl></div> |
Junio C Hamano | a372d5b | 2021-02-26 01:34:37 | [diff] [blame] | 1626 | <div class="paragraph"><p>In addition to recognizing all date formats above, the <code>--date</code> option |
| 1627 | will also try to make sense of other, more human-centric date formats, |
| 1628 | such as relative dates like "yesterday" or "last Friday at noon".</p></div> |
Junio C Hamano | bee061d | 2020-01-30 23:21:18 | [diff] [blame] | 1629 | </div> |
| 1630 | </div> |
| 1631 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1632 | <h2 id="_discussion">DISCUSSION</h2> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1633 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1634 | <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] | 1635 | with a single short (less than 50 character) line summarizing the |
| 1636 | change, followed by a blank line and then a more thorough description. |
Junio C Hamano | 281fd39 | 2012-09-17 23:57:41 | [diff] [blame] | 1637 | The text up to the first blank line in a commit message is treated |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1638 | as the commit title, and that title is used throughout Git. |
Junio C Hamano | 281fd39 | 2012-09-17 23:57:41 | [diff] [blame] | 1639 | For example, <a href="git-format-patch.html">git-format-patch(1)</a> turns a commit into email, and it uses |
| 1640 | the title on the Subject line and the rest of the commit in the body.</p></div> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 1641 | <div class="paragraph"><p>Git is to some extent character encoding agnostic.</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1642 | <div class="ulist"><ul> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1643 | <li> |
| 1644 | <p> |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 1645 | The contents of the blob objects are uninterpreted sequences |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1646 | of bytes. There is no encoding translation at the core |
| 1647 | level. |
| 1648 | </p> |
| 1649 | </li> |
| 1650 | <li> |
| 1651 | <p> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 1652 | Path 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 |
| 1660 | sequences of non-NUL bytes, there are no path name encoding |
| 1661 | conversions (except on Mac and Windows). Therefore, using |
| 1662 | non-ASCII path names will mostly work even on platforms and file |
| 1663 | systems that use legacy extended ASCII encodings. However, |
| 1664 | repositories created on such systems will not work properly on |
| 1665 | UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa. |
| 1666 | Additionally, many Git-based tools simply assume path names to |
| 1667 | be UTF-8 and will fail to display other encodings correctly.</p></div> |
| 1668 | </li> |
| 1669 | <li> |
| 1670 | <p> |
| 1671 | Commit 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 Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1676 | </p> |
| 1677 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1678 | </ul></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1679 | <div class="paragraph"><p>Although we encourage that the commit log messages are encoded |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1680 | in UTF-8, both the core and Git Porcelain are designed not to |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1681 | force UTF-8 on projects. If all participants of a particular |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1682 | project find it more convenient to use legacy encodings, Git |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1683 | 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] | 1684 | mind.</p></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1685 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1686 | <li> |
| 1687 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1688 | <em>git commit</em> and <em>git commit-tree</em> issues |
Junio C Hamano | 14b7648 | 2008-01-05 10:32:26 | [diff] [blame] | 1689 | 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] | 1690 | 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 Hamano | a372d5b | 2021-02-26 01:34:37 | [diff] [blame] | 1692 | have <code>i18n.commitEncoding</code> in <code>.git/config</code> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1693 | </p> |
| 1694 | <div class="listingblock"> |
| 1695 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1696 | <pre><code>[i18n] |
Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 1697 | commitEncoding = ISO-8859-1</code></pre> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1698 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1699 | <div class="paragraph"><p>Commit objects created with the above setting record the value |
Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 1700 | of <code>i18n.commitEncoding</code> in its <code>encoding</code> header. This is to |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1701 | help other people who look at them later. Lack of this header |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1702 | 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] | 1703 | </li> |
| 1704 | <li> |
| 1705 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1706 | <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1707 | <code>encoding</code> header of a commit object, and try to re-code the |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1708 | log message into UTF-8 unless otherwise specified. You can |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1709 | specify the desired output encoding with |
Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 1710 | <code>i18n.logOutputEncoding</code> in <code>.git/config</code> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1711 | </p> |
| 1712 | <div class="listingblock"> |
| 1713 | <div class="content"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1714 | <pre><code>[i18n] |
Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 1715 | logOutputEncoding = ISO-8859-1</code></pre> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1716 | </div></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1717 | <div class="paragraph"><p>If you do not have this configuration variable, the value of |
Junio C Hamano | bb34c10 | 2017-07-21 22:42:28 | [diff] [blame] | 1718 | <code>i18n.commitEncoding</code> is used instead.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1719 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1720 | </ol></div> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1721 | <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] | 1722 | message when a commit is made to force UTF-8 at the commit |
| 1723 | object level, because re-coding to UTF-8 is not necessarily a |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1724 | reversible operation.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 1725 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1726 | </div> |
| 1727 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1728 | <h2 id="_environment_and_configuration_variables">ENVIRONMENT AND CONFIGURATION VARIABLES</h2> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1729 | <div class="sectionbody"> |
Junio C Hamano | 6018664 | 2010-12-02 14:18:26 | [diff] [blame] | 1730 | <div class="paragraph"><p>The editor used to edit the commit log message will be chosen from the |
Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 1731 | <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 Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1733 | 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] | 1734 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1735 | </div> |
| 1736 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1737 | <h2 id="_hooks">HOOKS</h2> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1738 | <div class="sectionbody"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1739 | <div class="paragraph"><p>This command can run <code>commit-msg</code>, <code>prepare-commit-msg</code>, <code>pre-commit</code>, |
Junio C Hamano | cb06ef9 | 2017-03-21 22:40:14 | [diff] [blame] | 1740 | <code>post-commit</code> and <code>post-rewrite</code> hooks. See <a href="githooks.html">githooks(5)</a> for more |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1741 | information.</p></div> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1742 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1743 | </div> |
| 1744 | <div class="sect1"> |
Junio C Hamano | 28a85be | 2012-07-24 22:05:15 | [diff] [blame] | 1745 | <h2 id="_files">FILES</h2> |
| 1746 | <div class="sectionbody"> |
| 1747 | <div class="dlist"><dl> |
| 1748 | <dt class="hdlist1"> |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1749 | <code>$GIT_DIR/COMMIT_EDITMSG</code> |
Junio C Hamano | 28a85be | 2012-07-24 22:05:15 | [diff] [blame] | 1750 | </dt> |
| 1751 | <dd> |
| 1752 | <p> |
| 1753 | This file contains the commit message of a commit in progress. |
Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1754 | If <code>git commit</code> exits due to an error before creating a commit, |
Junio C Hamano | 28a85be | 2012-07-24 22:05:15 | [diff] [blame] | 1755 | 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 Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1757 | overwritten by the next invocation of <code>git commit</code>. |
Junio C Hamano | 28a85be | 2012-07-24 22:05:15 | [diff] [blame] | 1758 | </p> |
| 1759 | </dd> |
| 1760 | </dl></div> |
| 1761 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1762 | </div> |
| 1763 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1764 | <h2 id="_see_also">SEE ALSO</h2> |
Junio C Hamano | e7935c4 | 2006-12-13 21:32:17 | [diff] [blame] | 1765 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1766 | <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 Hamano | 40f2f8d | 2006-02-07 08:04:39 | [diff] [blame] | 1771 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1772 | </div> |
| 1773 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1774 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1775 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1776 | <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] | 1777 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1778 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1779 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1780 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1781 | <div id="footer"> |
| 1782 | <div id="footer-text"> |
Junio C Hamano | 2ef0ba3 | 2018-01-26 23:13:53 | [diff] [blame] | 1783 | Last updated |
Junio C Hamano | 14390e2 | 2022-03-17 01:11:12 | [diff] [blame] | 1784 | 2021-11-04 13:20:34 PDT |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1785 | </div> |
| 1786 | </div> |
| 1787 | </body> |
| 1788 | </html> |