Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
| 6 | <meta name="generator" content="AsciiDoc 8.6.8" /> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 7 | <title>gitcli(7)</title> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 8 | <style type="text/css"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 9 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 10 | |
| 11 | /* Default font. */ |
| 12 | body { |
| 13 | font-family: Georgia,serif; |
| 14 | } |
| 15 | |
| 16 | /* Title font. */ |
| 17 | h1, h2, h3, h4, h5, h6, |
| 18 | div.title, caption.title, |
| 19 | thead, p.table.header, |
| 20 | #toctitle, |
| 21 | #author, #revnumber, #revdate, #revremark, |
| 22 | #footer { |
| 23 | font-family: Arial,Helvetica,sans-serif; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | body { |
| 27 | margin: 1em 5% 1em 5%; |
| 28 | } |
| 29 | |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 30 | a { |
| 31 | color: blue; |
| 32 | text-decoration: underline; |
| 33 | } |
| 34 | a:visited { |
| 35 | color: fuchsia; |
| 36 | } |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 37 | |
| 38 | em { |
| 39 | font-style: italic; |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 40 | color: navy; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | strong { |
| 44 | font-weight: bold; |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 45 | color: #083194; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 46 | } |
| 47 | |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 48 | h1, h2, h3, h4, h5, h6 { |
| 49 | color: #527bbd; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 50 | margin-top: 1.2em; |
| 51 | margin-bottom: 0.5em; |
| 52 | line-height: 1.3; |
| 53 | } |
| 54 | |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 55 | h1, h2, h3 { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 56 | border-bottom: 2px solid silver; |
| 57 | } |
| 58 | h2 { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 59 | padding-top: 0.5em; |
| 60 | } |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 61 | h3 { |
| 62 | float: left; |
| 63 | } |
| 64 | h3 + * { |
| 65 | clear: left; |
| 66 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 67 | h5 { |
| 68 | font-size: 1.0em; |
| 69 | } |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 70 | |
| 71 | div.sectionbody { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 72 | margin-left: 0; |
| 73 | } |
| 74 | |
| 75 | hr { |
| 76 | border: 1px solid silver; |
| 77 | } |
| 78 | |
| 79 | p { |
| 80 | margin-top: 0.5em; |
| 81 | margin-bottom: 0.5em; |
| 82 | } |
| 83 | |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 84 | ul, ol, li > p { |
| 85 | margin-top: 0; |
| 86 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 87 | ul > li { color: #aaa; } |
| 88 | ul > li > * { color: black; } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 89 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 90 | .monospaced, code, pre { |
| 91 | font-family: "Courier New", Courier, monospace; |
| 92 | font-size: inherit; |
| 93 | color: navy; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 94 | padding: 0; |
| 95 | margin: 0; |
| 96 | } |
| 97 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 98 | |
| 99 | #author { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 100 | color: #527bbd; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 101 | font-weight: bold; |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 102 | font-size: 1.1em; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 103 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 104 | #email { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 105 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 106 | #revnumber, #revdate, #revremark { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 107 | } |
| 108 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 109 | #footer { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 110 | font-size: small; |
| 111 | border-top: 2px solid silver; |
| 112 | padding-top: 0.5em; |
| 113 | margin-top: 4.0em; |
| 114 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 115 | #footer-text { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 116 | float: left; |
| 117 | padding-bottom: 0.5em; |
| 118 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 119 | #footer-badges { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 120 | float: right; |
| 121 | padding-bottom: 0.5em; |
| 122 | } |
| 123 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 124 | #preamble { |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 125 | margin-top: 1.5em; |
| 126 | margin-bottom: 1.5em; |
| 127 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 128 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 129 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 130 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 131 | margin-top: 1.0em; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 132 | margin-bottom: 1.5em; |
| 133 | } |
| 134 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 135 | margin-top: 2.0em; |
| 136 | margin-bottom: 2.0em; |
| 137 | margin-right: 10%; |
| 138 | color: #606060; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | div.content { /* Block element content. */ |
| 142 | padding: 0; |
| 143 | } |
| 144 | |
| 145 | /* Block element titles. */ |
| 146 | div.title, caption.title { |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 147 | color: #527bbd; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 148 | font-weight: bold; |
| 149 | text-align: left; |
| 150 | margin-top: 1.0em; |
| 151 | margin-bottom: 0.5em; |
| 152 | } |
| 153 | div.title + * { |
| 154 | margin-top: 0; |
| 155 | } |
| 156 | |
| 157 | td div.title:first-child { |
| 158 | margin-top: 0.0em; |
| 159 | } |
| 160 | div.content div.title:first-child { |
| 161 | margin-top: 0.0em; |
| 162 | } |
| 163 | div.content + div.title { |
| 164 | margin-top: 0.0em; |
| 165 | } |
| 166 | |
| 167 | div.sidebarblock > div.content { |
| 168 | background: #ffffee; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 169 | border: 1px solid #dddddd; |
| 170 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 171 | padding: 0.5em; |
| 172 | } |
| 173 | |
| 174 | div.listingblock > div.content { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 175 | border: 1px solid #dddddd; |
| 176 | border-left: 5px solid #f0f0f0; |
| 177 | background: #f8f8f8; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 178 | padding: 0.5em; |
| 179 | } |
| 180 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 181 | div.quoteblock, div.verseblock { |
| 182 | padding-left: 1.0em; |
| 183 | margin-left: 1.0em; |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 184 | margin-right: 10%; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 185 | border-left: 5px solid #f0f0f0; |
| 186 | color: #888; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 187 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 188 | |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 189 | div.quoteblock > div.attribution { |
| 190 | padding-top: 0.5em; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 191 | text-align: right; |
| 192 | } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 193 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 194 | div.verseblock > pre.content { |
| 195 | font-family: inherit; |
| 196 | font-size: inherit; |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 197 | } |
| 198 | div.verseblock > div.attribution { |
| 199 | padding-top: 0.75em; |
| 200 | text-align: left; |
| 201 | } |
| 202 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 203 | div.verseblock + div.attribution { |
| 204 | text-align: left; |
| 205 | } |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 206 | |
| 207 | div.admonitionblock .icon { |
| 208 | vertical-align: top; |
| 209 | font-size: 1.1em; |
| 210 | font-weight: bold; |
| 211 | text-decoration: underline; |
| 212 | color: #527bbd; |
| 213 | padding-right: 0.5em; |
| 214 | } |
| 215 | div.admonitionblock td.content { |
| 216 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 217 | border-left: 3px solid #dddddd; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 221 | border-left: 3px solid #dddddd; |
| 222 | padding-left: 0.5em; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 223 | } |
| 224 | |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 225 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 226 | span.image img { border-style: none; } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 227 | a.image:visited { color: white; } |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 228 | |
| 229 | dl { |
| 230 | margin-top: 0.8em; |
| 231 | margin-bottom: 0.8em; |
| 232 | } |
| 233 | dt { |
| 234 | margin-top: 0.5em; |
| 235 | margin-bottom: 0; |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 236 | font-style: normal; |
| 237 | color: navy; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 238 | } |
| 239 | dd > *:first-child { |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 240 | margin-top: 0.1em; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | ul, ol { |
| 244 | list-style-position: outside; |
| 245 | } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 246 | ol.arabic { |
| 247 | list-style-type: decimal; |
| 248 | } |
| 249 | ol.loweralpha { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 250 | list-style-type: lower-alpha; |
| 251 | } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 252 | ol.upperalpha { |
| 253 | list-style-type: upper-alpha; |
| 254 | } |
| 255 | ol.lowerroman { |
| 256 | list-style-type: lower-roman; |
| 257 | } |
| 258 | ol.upperroman { |
| 259 | list-style-type: upper-roman; |
| 260 | } |
| 261 | |
| 262 | div.compact ul, div.compact ol, |
| 263 | div.compact p, div.compact p, |
| 264 | div.compact div, div.compact div { |
| 265 | margin-top: 0.1em; |
| 266 | margin-bottom: 0.1em; |
| 267 | } |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 268 | |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 269 | tfoot { |
| 270 | font-weight: bold; |
| 271 | } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 272 | td > div.verse { |
| 273 | white-space: pre; |
| 274 | } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 275 | |
| 276 | div.hdlist { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 277 | margin-top: 0.8em; |
| 278 | margin-bottom: 0.8em; |
| 279 | } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 280 | div.hdlist tr { |
| 281 | padding-bottom: 15px; |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 282 | } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 283 | dt.hdlist1.strong, td.hdlist1.strong { |
| 284 | font-weight: bold; |
| 285 | } |
| 286 | td.hdlist1 { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 287 | vertical-align: top; |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 288 | font-style: normal; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 289 | padding-right: 0.8em; |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 290 | color: navy; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 291 | } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 292 | td.hdlist2 { |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 293 | vertical-align: top; |
| 294 | } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 295 | div.hdlist.compact tr { |
| 296 | margin: 0; |
| 297 | padding-bottom: 0; |
| 298 | } |
| 299 | |
| 300 | .comment { |
| 301 | background: yellow; |
| 302 | } |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 303 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 304 | .footnote, .footnoteref { |
| 305 | font-size: 0.8em; |
| 306 | } |
| 307 | |
| 308 | span.footnote, span.footnoteref { |
| 309 | vertical-align: super; |
| 310 | } |
| 311 | |
| 312 | #footnotes { |
| 313 | margin: 20px 0 20px 0; |
| 314 | padding: 7px 0 0 0; |
| 315 | } |
| 316 | |
| 317 | #footnotes div.footnote { |
| 318 | margin: 0 0 5px 0; |
| 319 | } |
| 320 | |
| 321 | #footnotes hr { |
| 322 | border: none; |
| 323 | border-top: 1px solid silver; |
| 324 | height: 1px; |
| 325 | text-align: left; |
| 326 | margin-left: 0; |
| 327 | width: 20%; |
| 328 | min-width: 100px; |
| 329 | } |
| 330 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 331 | div.colist td { |
| 332 | padding-right: 0.5em; |
| 333 | padding-bottom: 0.3em; |
| 334 | vertical-align: top; |
| 335 | } |
| 336 | div.colist td img { |
| 337 | margin-top: 0.3em; |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 338 | } |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 339 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 340 | @media print { |
| 341 | #footer-badges { display: none; } |
| 342 | } |
| 343 | |
| 344 | #toc { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 345 | margin-bottom: 2.5em; |
| 346 | } |
| 347 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 348 | #toctitle { |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 349 | color: #527bbd; |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 350 | font-size: 1.1em; |
| 351 | font-weight: bold; |
| 352 | margin-top: 1.0em; |
| 353 | margin-bottom: 0.1em; |
| 354 | } |
| 355 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 356 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 357 | margin-top: 0; |
| 358 | margin-bottom: 0; |
| 359 | } |
| 360 | div.toclevel2 { |
| 361 | margin-left: 2em; |
| 362 | font-size: 0.9em; |
| 363 | } |
| 364 | div.toclevel3 { |
| 365 | margin-left: 4em; |
| 366 | font-size: 0.9em; |
| 367 | } |
| 368 | div.toclevel4 { |
| 369 | margin-left: 6em; |
| 370 | font-size: 0.9em; |
| 371 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 372 | |
| 373 | span.aqua { color: aqua; } |
| 374 | span.black { color: black; } |
| 375 | span.blue { color: blue; } |
| 376 | span.fuchsia { color: fuchsia; } |
| 377 | span.gray { color: gray; } |
| 378 | span.green { color: green; } |
| 379 | span.lime { color: lime; } |
| 380 | span.maroon { color: maroon; } |
| 381 | span.navy { color: navy; } |
| 382 | span.olive { color: olive; } |
| 383 | span.purple { color: purple; } |
| 384 | span.red { color: red; } |
| 385 | span.silver { color: silver; } |
| 386 | span.teal { color: teal; } |
| 387 | span.white { color: white; } |
| 388 | span.yellow { color: yellow; } |
| 389 | |
| 390 | span.aqua-background { background: aqua; } |
| 391 | span.black-background { background: black; } |
| 392 | span.blue-background { background: blue; } |
| 393 | span.fuchsia-background { background: fuchsia; } |
| 394 | span.gray-background { background: gray; } |
| 395 | span.green-background { background: green; } |
| 396 | span.lime-background { background: lime; } |
| 397 | span.maroon-background { background: maroon; } |
| 398 | span.navy-background { background: navy; } |
| 399 | span.olive-background { background: olive; } |
| 400 | span.purple-background { background: purple; } |
| 401 | span.red-background { background: red; } |
| 402 | span.silver-background { background: silver; } |
| 403 | span.teal-background { background: teal; } |
| 404 | span.white-background { background: white; } |
| 405 | span.yellow-background { background: yellow; } |
| 406 | |
| 407 | span.big { font-size: 2em; } |
| 408 | span.small { font-size: 0.6em; } |
| 409 | |
| 410 | span.underline { text-decoration: underline; } |
| 411 | span.overline { text-decoration: overline; } |
| 412 | span.line-through { text-decoration: line-through; } |
| 413 | |
| 414 | div.unbreakable { page-break-inside: avoid; } |
| 415 | |
| 416 | |
| 417 | /* |
| 418 | * xhtml11 specific |
| 419 | * |
| 420 | * */ |
| 421 | |
| 422 | div.tableblock { |
| 423 | margin-top: 1.0em; |
| 424 | margin-bottom: 1.5em; |
| 425 | } |
| 426 | div.tableblock > table { |
| 427 | border: 3px solid #527bbd; |
| 428 | } |
| 429 | thead, p.table.header { |
| 430 | font-weight: bold; |
| 431 | color: #527bbd; |
| 432 | } |
| 433 | p.table { |
| 434 | margin-top: 0; |
| 435 | } |
| 436 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 437 | div.tableblock > table[frame="void"] { |
| 438 | border-style: none; |
| 439 | } |
| 440 | div.tableblock > table[frame="hsides"] { |
| 441 | border-left-style: none; |
| 442 | border-right-style: none; |
| 443 | } |
| 444 | div.tableblock > table[frame="vsides"] { |
| 445 | border-top-style: none; |
| 446 | border-bottom-style: none; |
| 447 | } |
| 448 | |
| 449 | |
| 450 | /* |
| 451 | * html5 specific |
| 452 | * |
| 453 | * */ |
| 454 | |
| 455 | table.tableblock { |
| 456 | margin-top: 1.0em; |
| 457 | margin-bottom: 1.5em; |
| 458 | } |
| 459 | thead, p.tableblock.header { |
| 460 | font-weight: bold; |
| 461 | color: #527bbd; |
| 462 | } |
| 463 | p.tableblock { |
| 464 | margin-top: 0; |
| 465 | } |
| 466 | table.tableblock { |
| 467 | border-width: 3px; |
| 468 | border-spacing: 0px; |
| 469 | border-style: solid; |
| 470 | border-color: #527bbd; |
| 471 | border-collapse: collapse; |
| 472 | } |
| 473 | th.tableblock, td.tableblock { |
| 474 | border-width: 1px; |
| 475 | padding: 4px; |
| 476 | border-style: solid; |
| 477 | border-color: #527bbd; |
| 478 | } |
| 479 | |
| 480 | table.tableblock.frame-topbot { |
| 481 | border-left-style: hidden; |
| 482 | border-right-style: hidden; |
| 483 | } |
| 484 | table.tableblock.frame-sides { |
| 485 | border-top-style: hidden; |
| 486 | border-bottom-style: hidden; |
| 487 | } |
| 488 | table.tableblock.frame-none { |
| 489 | border-style: hidden; |
| 490 | } |
| 491 | |
| 492 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 493 | text-align: left; |
| 494 | } |
| 495 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 496 | text-align: center; |
| 497 | } |
| 498 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 499 | text-align: right; |
| 500 | } |
| 501 | |
| 502 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 503 | vertical-align: top; |
| 504 | } |
| 505 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 506 | vertical-align: middle; |
| 507 | } |
| 508 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 509 | vertical-align: bottom; |
| 510 | } |
| 511 | |
| 512 | |
| 513 | /* |
| 514 | * manpage specific |
| 515 | * |
| 516 | * */ |
| 517 | |
| 518 | body.manpage h1 { |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 519 | padding-top: 0.5em; |
| 520 | padding-bottom: 0.5em; |
| 521 | border-top: 2px solid silver; |
| 522 | border-bottom: 2px solid silver; |
| 523 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 524 | body.manpage h2 { |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 525 | border-style: none; |
| 526 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 527 | body.manpage div.sectionbody { |
| 528 | margin-left: 3em; |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 529 | } |
| 530 | |
| 531 | @media print { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 532 | body.manpage div#toc { display: none; } |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 533 | } |
| 534 | |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 535 | |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 536 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 537 | <script type="text/javascript"> |
| 538 | /*<![CDATA[*/ |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 539 | var asciidoc = { // Namespace. |
| 540 | |
| 541 | ///////////////////////////////////////////////////////////////////// |
| 542 | // Table Of Contents generator |
| 543 | ///////////////////////////////////////////////////////////////////// |
| 544 | |
| 545 | /* Author: Mihai Bazon, September 2002 |
| 546 | * http://students.infoiasi.ro/~mishoo |
| 547 | * |
| 548 | * Table Of Content generator |
| 549 | * Version: 0.4 |
| 550 | * |
| 551 | * Feel free to use this script under the terms of the GNU General Public |
| 552 | * License, as long as you do not remove or alter this notice. |
| 553 | */ |
| 554 | |
| 555 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 556 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 557 | |
| 558 | // toclevels = 1..4. |
| 559 | toc: function (toclevels) { |
| 560 | |
| 561 | function getText(el) { |
| 562 | var text = ""; |
| 563 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 564 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 565 | text += i.data; |
| 566 | else if (i.firstChild != null) |
| 567 | text += getText(i); |
| 568 | } |
| 569 | return text; |
| 570 | } |
| 571 | |
| 572 | function TocEntry(el, text, toclevel) { |
| 573 | this.element = el; |
| 574 | this.text = text; |
| 575 | this.toclevel = toclevel; |
| 576 | } |
| 577 | |
| 578 | function tocEntries(el, toclevels) { |
| 579 | var result = new Array; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 580 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 581 | // Function that scans the DOM tree for header elements (the DOM2 |
| 582 | // nodeIterator API would be a better technique but not supported by all |
| 583 | // browsers). |
| 584 | var iterate = function (el) { |
| 585 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 586 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 587 | var mo = re.exec(i.tagName); |
| 588 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 589 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 590 | } |
| 591 | iterate(i); |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | iterate(el); |
| 596 | return result; |
| 597 | } |
| 598 | |
| 599 | var toc = document.getElementById("toc"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 600 | if (!toc) { |
| 601 | return; |
| 602 | } |
| 603 | |
| 604 | // Delete existing TOC entries in case we're reloading the TOC. |
| 605 | var tocEntriesToRemove = []; |
| 606 | var i; |
| 607 | for (i = 0; i < toc.childNodes.length; i++) { |
| 608 | var entry = toc.childNodes[i]; |
| 609 | if (entry.nodeName.toLowerCase() == 'div' |
| 610 | && entry.getAttribute("class") |
| 611 | && entry.getAttribute("class").match(/^toclevel/)) |
| 612 | tocEntriesToRemove.push(entry); |
| 613 | } |
| 614 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 615 | toc.removeChild(tocEntriesToRemove[i]); |
| 616 | } |
| 617 | |
| 618 | // Rebuild TOC entries. |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 619 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 620 | for (var i = 0; i < entries.length; ++i) { |
| 621 | var entry = entries[i]; |
| 622 | if (entry.element.id == "") |
| 623 | entry.element.id = "_toc_" + i; |
| 624 | var a = document.createElement("a"); |
| 625 | a.href = "#" + entry.element.id; |
| 626 | a.appendChild(document.createTextNode(entry.text)); |
| 627 | var div = document.createElement("div"); |
| 628 | div.appendChild(a); |
| 629 | div.className = "toclevel" + entry.toclevel; |
| 630 | toc.appendChild(div); |
| 631 | } |
| 632 | if (entries.length == 0) |
| 633 | toc.parentNode.removeChild(toc); |
| 634 | }, |
| 635 | |
| 636 | |
| 637 | ///////////////////////////////////////////////////////////////////// |
| 638 | // Footnotes generator |
| 639 | ///////////////////////////////////////////////////////////////////// |
| 640 | |
| 641 | /* Based on footnote generation code from: |
| 642 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 643 | */ |
| 644 | |
| 645 | footnotes: function () { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 646 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 647 | var i; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 648 | var noteholder = document.getElementById("footnotes"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 649 | if (!noteholder) { |
| 650 | return; |
| 651 | } |
| 652 | var entriesToRemove = []; |
| 653 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 654 | var entry = noteholder.childNodes[i]; |
| 655 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
| 656 | entriesToRemove.push(entry); |
| 657 | } |
| 658 | for (i = 0; i < entriesToRemove.length; i++) { |
| 659 | noteholder.removeChild(entriesToRemove[i]); |
| 660 | } |
| 661 | |
| 662 | // Rebuild footnote entries. |
| 663 | var cont = document.getElementById("content"); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 664 | var spans = cont.getElementsByTagName("span"); |
| 665 | var refs = {}; |
| 666 | var n = 0; |
| 667 | for (i=0; i<spans.length; i++) { |
| 668 | if (spans[i].className == "footnote") { |
| 669 | n++; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 670 | var note = spans[i].getAttribute("data-note"); |
| 671 | if (!note) { |
| 672 | // Use [\s\S] in place of . so multi-line matches work. |
| 673 | // Because JavaScript has no s (dotall) regex flag. |
| 674 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 675 | spans[i].innerHTML = |
| 676 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 677 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 678 | spans[i].setAttribute("data-note", note); |
| 679 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 680 | noteholder.innerHTML += |
| 681 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 682 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 683 | n + "</a>. " + note + "</div>"; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 684 | var id =spans[i].getAttribute("id"); |
| 685 | if (id != null) refs["#"+id] = n; |
| 686 | } |
| 687 | } |
| 688 | if (n == 0) |
| 689 | noteholder.parentNode.removeChild(noteholder); |
| 690 | else { |
| 691 | // Process footnoterefs. |
| 692 | for (i=0; i<spans.length; i++) { |
| 693 | if (spans[i].className == "footnoteref") { |
| 694 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 695 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 696 | n = refs[href]; |
| 697 | spans[i].innerHTML = |
| 698 | "[<a href='#_footnote_" + n + |
| 699 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 700 | } |
| 701 | } |
| 702 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 703 | }, |
| 704 | |
| 705 | install: function(toclevels) { |
| 706 | var timerId; |
| 707 | |
| 708 | function reinstall() { |
| 709 | asciidoc.footnotes(); |
| 710 | if (toclevels) { |
| 711 | asciidoc.toc(toclevels); |
| 712 | } |
| 713 | } |
| 714 | |
| 715 | function reinstallAndRemoveTimer() { |
| 716 | clearInterval(timerId); |
| 717 | reinstall(); |
| 718 | } |
| 719 | |
| 720 | timerId = setInterval(reinstall, 500); |
| 721 | if (document.addEventListener) |
| 722 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 723 | else |
| 724 | window.onload = reinstallAndRemoveTimer; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 725 | } |
| 726 | |
| 727 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 728 | asciidoc.install(); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 729 | /*]]>*/ |
| 730 | </script> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 731 | </head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 732 | <body class="manpage"> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 733 | <div id="header"> |
| 734 | <h1> |
Junio C Hamano | 2fbcd21 | 2008-05-14 22:26:07 | [diff] [blame] | 735 | gitcli(7) Manual Page |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 736 | </h1> |
| 737 | <h2>NAME</h2> |
| 738 | <div class="sectionbody"> |
| 739 | <p>gitcli - |
| 740 | git command line interface and conventions |
| 741 | </p> |
| 742 | </div> |
| 743 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 744 | <div id="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 745 | <div class="sect1"> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 746 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 747 | <div class="sectionbody"> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 748 | <div class="paragraph"><p>gitcli</p></div> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 749 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 750 | </div> |
| 751 | <div class="sect1"> |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 752 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 753 | <div class="sectionbody"> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 754 | <div class="paragraph"><p>This manual describes the convention used throughout git CLI.</p></div> |
| 755 | <div class="paragraph"><p>Many commands take revisions (most often "commits", but sometimes |
Junio C Hamano | c4fec20 | 2008-06-28 10:07:24 | [diff] [blame] | 756 | "tree-ish", depending on the context and command) and paths as their |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 757 | arguments. Here are the rules:</p></div> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 758 | <div class="ulist"><ul> |
Junio C Hamano | c4fec20 | 2008-06-28 10:07:24 | [diff] [blame] | 759 | <li> |
| 760 | <p> |
| 761 | Revisions come first and then paths. |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 762 | E.g. in <code>git diff v1.0 v2.0 arch/x86 include/asm-x86</code>, |
| 763 | <code>v1.0</code> and <code>v2.0</code> are revisions and <code>arch/x86</code> and <code>include/asm-x86</code> |
Junio C Hamano | c4fec20 | 2008-06-28 10:07:24 | [diff] [blame] | 764 | are paths. |
| 765 | </p> |
| 766 | </li> |
| 767 | <li> |
| 768 | <p> |
| 769 | When an argument can be misunderstood as either a revision or a path, |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 770 | they can be disambiguated by placing <code>--</code> between them. |
| 771 | E.g. <code>git diff -- HEAD</code> is, "I have a file called HEAD in my work |
Junio C Hamano | c4fec20 | 2008-06-28 10:07:24 | [diff] [blame] | 772 | tree. Please show changes between the version I staged in the index |
| 773 | and what I have in the work tree for that file". not "show difference |
| 774 | between the HEAD commit and the work tree as a whole". You can say |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 775 | <code>git diff HEAD --</code> to ask for the latter. |
Junio C Hamano | c4fec20 | 2008-06-28 10:07:24 | [diff] [blame] | 776 | </p> |
| 777 | </li> |
| 778 | <li> |
| 779 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 780 | Without disambiguating <code>--</code>, git makes a reasonable guess, but errors |
Junio C Hamano | c4fec20 | 2008-06-28 10:07:24 | [diff] [blame] | 781 | out and asking you to disambiguate when ambiguous. E.g. if you have a |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 782 | file called HEAD in your work tree, <code>git diff HEAD</code> is ambiguous, and |
| 783 | you have to say either <code>git diff HEAD --</code> or <code>git diff -- HEAD</code> to |
Junio C Hamano | c4fec20 | 2008-06-28 10:07:24 | [diff] [blame] | 784 | disambiguate. |
| 785 | </p> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 786 | <div class="paragraph"><p>When writing a script that is expected to handle random user-input, it is |
Junio C Hamano | c4fec20 | 2008-06-28 10:07:24 | [diff] [blame] | 787 | a good practice to make it explicit which arguments are which by placing |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 788 | disambiguating <code>--</code> at appropriate places.</p></div> |
Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 789 | </li> |
| 790 | <li> |
| 791 | <p> |
| 792 | Many commands allow wildcards in paths, but you need to protect |
| 793 | them from getting globbed by the shell. These two mean different |
| 794 | things: |
| 795 | </p> |
| 796 | <div class="listingblock"> |
| 797 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 798 | <pre><code>$ git checkout -- *.c |
| 799 | $ git checkout -- \*.c</code></pre> |
Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 800 | </div></div> |
| 801 | <div class="paragraph"><p>The former lets your shell expand the fileglob, and you are asking |
| 802 | the dot-C files in your working tree to be overwritten with the version |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 803 | in the index. The latter passes the <code>*.c</code> to Git, and you are asking |
Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 804 | the paths in the index that match the pattern to be checked out to your |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 805 | working tree. After running <code>git add hello.c; rm hello.c</code>, you will <em>not</em> |
| 806 | see <code>hello.c</code> in your working tree with the former, but with the latter |
Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 807 | you will.</p></div> |
| 808 | </li> |
| 809 | </ul></div> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 810 | <div class="paragraph"><p>Here are the rules regarding the "flags" that you should follow when you are |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 811 | scripting git:</p></div> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 812 | <div class="ulist"><ul> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 813 | <li> |
| 814 | <p> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 815 | it’s preferred to use the non dashed form of git commands, which means that |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 816 | you should prefer <code>git foo</code> to <code>git-foo</code>. |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 817 | </p> |
| 818 | </li> |
| 819 | <li> |
| 820 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 821 | splitting short options to separate words (prefer <code>git foo -a -b</code> |
| 822 | to <code>git foo -ab</code>, the latter may not even work). |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 823 | </p> |
| 824 | </li> |
| 825 | <li> |
| 826 | <p> |
| 827 | when a command line option takes an argument, use the <em>sticked</em> form. In |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 828 | other words, write <code>git foo -oArg</code> instead of <code>git foo -o Arg</code> for short |
| 829 | options, and <code>git foo --long-opt=Arg</code> instead of <code>git foo --long-opt Arg</code> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 830 | for long options. An option that takes optional option-argument must be |
| 831 | written in the <em>sticked</em> form. |
| 832 | </p> |
| 833 | </li> |
| 834 | <li> |
| 835 | <p> |
| 836 | when you give a revision parameter to a command, make sure the parameter is |
| 837 | not ambiguous with a name of a file in the work tree. E.g. do not write |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 838 | <code>git log -1 HEAD</code> but write <code>git log -1 HEAD --</code>; the former will not work |
| 839 | if you happen to have a file called <code>HEAD</code> in the work tree. |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 840 | </p> |
| 841 | </li> |
Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 842 | <li> |
| 843 | <p> |
| 844 | many commands allow a long option "--option" to be abbreviated |
| 845 | only to their unique prefix (e.g. if there is no other option |
| 846 | whose name begins with "opt", you may be able to spell "--opt" to |
| 847 | invoke the "--option" flag), but you should fully spell them out |
| 848 | when writing your scripts; later versions of Git may introduce a |
| 849 | new option whose name shares the same prefix, e.g. "--optimize", |
| 850 | to make a short prefix that used to be unique no longer unique. |
| 851 | </p> |
| 852 | </li> |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 853 | </ul></div> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 854 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 855 | </div> |
| 856 | <div class="sect1"> |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 857 | <h2 id="_enhanced_option_parser">ENHANCED OPTION PARSER</h2> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 858 | <div class="sectionbody"> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 859 | <div class="paragraph"><p>From the git 1.5.4 series and further, many git commands (not all of them at the |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 860 | time of the writing though) come with an enhanced option parser.</p></div> |
Junio C Hamano | 6631a09 | 2012-10-10 22:50:57 | [diff] [blame] | 861 | <div class="paragraph"><p>Here is a list of the facilities provided by this option parser.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 862 | <div class="sect2"> |
| 863 | <h3 id="_magic_options">Magic Options</h3> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 864 | <div class="paragraph"><p>Commands which have the enhanced option parser activated all understand a |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 865 | couple of magic command line options:</p></div> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 866 | <div class="dlist"><dl> |
| 867 | <dt class="hdlist1"> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 868 | -h |
| 869 | </dt> |
| 870 | <dd> |
| 871 | <p> |
| 872 | gives a pretty printed usage of the command. |
| 873 | </p> |
| 874 | <div class="listingblock"> |
| 875 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 876 | <pre><code>$ git describe -h |
Junio C Hamano | e74124b | 2009-09-23 06:51:01 | [diff] [blame] | 877 | usage: git describe [options] <committish>* |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 878 | |
| 879 | --contains find the tag that comes after the commit |
| 880 | --debug debug search strategy on stderr |
| 881 | --all use any ref in .git/refs |
| 882 | --tags use any tag in .git/refs/tags |
| 883 | --abbrev [<n>] use <n> digits to display SHA-1s |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 884 | --candidates <n> consider <n> most recent tags (default: 10)</code></pre> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 885 | </div></div> |
| 886 | </dd> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 887 | <dt class="hdlist1"> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 888 | --help-all |
| 889 | </dt> |
| 890 | <dd> |
| 891 | <p> |
| 892 | Some git commands take options that are only used for plumbing or that |
| 893 | are deprecated, and such options are hidden from the default usage. This |
| 894 | option gives the full list of options. |
| 895 | </p> |
| 896 | </dd> |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 897 | </dl></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 898 | </div> |
| 899 | <div class="sect2"> |
| 900 | <h3 id="_negating_options">Negating options</h3> |
| 901 | <div class="paragraph"><p>Options with long option names can be negated by prefixing <code>--no-</code>. For |
| 902 | example, <code>git branch</code> has the option <code>--track</code> which is <em>on</em> by default. You |
| 903 | can use <code>--no-track</code> to override that behaviour. The same goes for <code>--color</code> |
| 904 | and <code>--no-color</code>.</p></div> |
| 905 | </div> |
| 906 | <div class="sect2"> |
| 907 | <h3 id="_aggregating_short_options">Aggregating short options</h3> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 908 | <div class="paragraph"><p>Commands that support the enhanced option parser allow you to aggregate short |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 909 | options. This means that you can for example use <code>git rm -rf</code> or |
| 910 | <code>git clean -fdx</code>.</p></div> |
| 911 | </div> |
| 912 | <div class="sect2"> |
| 913 | <h3 id="_abbreviating_long_options">Abbreviating long options</h3> |
Junio C Hamano | 6631a09 | 2012-10-10 22:50:57 | [diff] [blame] | 914 | <div class="paragraph"><p>Commands that support the enhanced option parser accepts unique |
| 915 | prefix of a long option as if it is fully spelled out, but use this |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 916 | with a caution. For example, <code>git commit --amen</code> behaves as if you |
| 917 | typed <code>git commit --amend</code>, but that is true only until a later version |
Junio C Hamano | 6631a09 | 2012-10-10 22:50:57 | [diff] [blame] | 918 | of Git introduces another option that shares the same prefix, |
| 919 | e.g `git commit --amenity" option.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 920 | </div> |
| 921 | <div class="sect2"> |
| 922 | <h3 id="_separating_argument_from_the_option">Separating argument from the option</h3> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 923 | <div class="paragraph"><p>You can write the mandatory option parameter to an option as a separate |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 924 | word on the command line. That means that all the following uses work:</p></div> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 925 | <div class="listingblock"> |
| 926 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 927 | <pre><code>$ git foo --long-opt=Arg |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 928 | $ git foo --long-opt Arg |
| 929 | $ git foo -oArg |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 930 | $ git foo -o Arg</code></pre> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 931 | </div></div> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 932 | <div class="paragraph"><p>However, this is <strong>NOT</strong> allowed for switches with an optional value, where the |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 933 | <em>sticked</em> form must be used:</p></div> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 934 | <div class="listingblock"> |
| 935 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 936 | <pre><code>$ git describe --abbrev HEAD # correct |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 937 | $ git describe --abbrev=10 HEAD # correct |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 938 | $ git describe --abbrev 10 HEAD # NOT WHAT YOU MEANT</code></pre> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 939 | </div></div> |
| 940 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 941 | </div> |
| 942 | </div> |
| 943 | <div class="sect1"> |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 944 | <h2 id="_notes_on_frequently_confused_options">NOTES ON FREQUENTLY CONFUSED OPTIONS</h2> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 945 | <div class="sectionbody"> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 946 | <div class="paragraph"><p>Many commands that can work on files in the working tree |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 947 | and/or in the index can take <code>--cached</code> and/or <code>--index</code> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 948 | options. Sometimes people incorrectly think that, because |
| 949 | the index was originally called cache, these two are |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 950 | synonyms. They are <strong>not</strong> — these two options mean very |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 951 | different things.</p></div> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 952 | <div class="ulist"><ul> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 953 | <li> |
| 954 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 955 | The <code>--cached</code> option is used to ask a command that |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 956 | usually works on files in the working tree to <strong>only</strong> work |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 957 | with the index. For example, <code>git grep</code>, when used |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 958 | without a commit to specify from which commit to look for |
| 959 | strings in, usually works on files in the working tree, |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 960 | but with the <code>--cached</code> option, it looks for strings in |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 961 | the index. |
| 962 | </p> |
| 963 | </li> |
| 964 | <li> |
| 965 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 966 | The <code>--index</code> option is used to ask a command that |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 967 | usually works on files in the working tree to <strong>also</strong> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 968 | affect the index. For example, <code>git stash apply</code> usually |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 969 | merges changes recorded in a stash to the working tree, |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 970 | but with the <code>--index</code> option, it also merges changes to |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 971 | the index as well. |
| 972 | </p> |
| 973 | </li> |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 974 | </ul></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 975 | <div class="paragraph"><p><code>git apply</code> command can be used with <code>--cached</code> and |
| 976 | <code>--index</code> (but not at the same time). Usually the command |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 977 | only affects the files in the working tree, but with |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 978 | <code>--index</code>, it patches both the files and their index |
| 979 | entries, and with <code>--cached</code>, it modifies only the index |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 980 | entries.</p></div> |
Junio C Hamano | 103b572 | 2011-01-31 05:03:45 | [diff] [blame] | 981 | <div class="paragraph"><p>See also <a href="http://marc.info/?l=git&m=116563135620359">http://marc.info/?l=git&m=116563135620359</a> and |
| 982 | <a href="http://marc.info/?l=git&m=119150393620273">http://marc.info/?l=git&m=119150393620273</a> for further |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 983 | information.</p></div> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 984 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 985 | </div> |
| 986 | <div class="sect1"> |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 987 | <h2 id="_git">GIT</h2> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 988 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 989 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 990 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 991 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 992 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 993 | <div id="footnotes"><hr /></div> |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 994 | <div id="footer"> |
| 995 | <div id="footer-text"> |
Junio C Hamano | 6631a09 | 2012-10-10 22:50:57 | [diff] [blame] | 996 | Last updated 2012-10-10 15:49:24 PDT |
Junio C Hamano | f556fc2 | 2007-12-23 08:16:38 | [diff] [blame] | 997 | </div> |
| 998 | </div> |
| 999 | </body> |
| 1000 | </html> |