Junio C Hamano | 944ce25 | 2018-05-30 22:25:26 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [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> |
| 6 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
Junio C Hamano | 98c882d | 2020-08-13 22:06:57 | [diff] [blame] | 7 | <meta name="generator" content="AsciiDoc 9.0.0rc2" /> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 8 | <title>giteveryday(7)</title> |
| 9 | <style type="text/css"> |
| 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; |
| 25 | } |
| 26 | |
| 27 | body { |
| 28 | margin: 1em 5% 1em 5%; |
| 29 | } |
| 30 | |
| 31 | a { |
| 32 | color: blue; |
| 33 | text-decoration: underline; |
| 34 | } |
| 35 | a:visited { |
| 36 | color: fuchsia; |
| 37 | } |
| 38 | |
| 39 | em { |
| 40 | font-style: italic; |
| 41 | color: navy; |
| 42 | } |
| 43 | |
| 44 | strong { |
| 45 | font-weight: bold; |
| 46 | color: #083194; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3, h4, h5, h6 { |
| 50 | color: #527bbd; |
| 51 | margin-top: 1.2em; |
| 52 | margin-bottom: 0.5em; |
| 53 | line-height: 1.3; |
| 54 | } |
| 55 | |
| 56 | h1, h2, h3 { |
| 57 | border-bottom: 2px solid silver; |
| 58 | } |
| 59 | h2 { |
| 60 | padding-top: 0.5em; |
| 61 | } |
| 62 | h3 { |
| 63 | float: left; |
| 64 | } |
| 65 | h3 + * { |
| 66 | clear: left; |
| 67 | } |
| 68 | h5 { |
| 69 | font-size: 1.0em; |
| 70 | } |
| 71 | |
| 72 | div.sectionbody { |
| 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 | |
| 85 | ul, ol, li > p { |
| 86 | margin-top: 0; |
| 87 | } |
| 88 | ul > li { color: #aaa; } |
| 89 | ul > li > * { color: black; } |
| 90 | |
| 91 | .monospaced, code, pre { |
| 92 | font-family: "Courier New", Courier, monospace; |
| 93 | font-size: inherit; |
| 94 | color: navy; |
| 95 | padding: 0; |
| 96 | margin: 0; |
| 97 | } |
| 98 | pre { |
| 99 | white-space: pre-wrap; |
| 100 | } |
| 101 | |
| 102 | #author { |
| 103 | color: #527bbd; |
| 104 | font-weight: bold; |
| 105 | font-size: 1.1em; |
| 106 | } |
| 107 | #email { |
| 108 | } |
| 109 | #revnumber, #revdate, #revremark { |
| 110 | } |
| 111 | |
| 112 | #footer { |
| 113 | font-size: small; |
| 114 | border-top: 2px solid silver; |
| 115 | padding-top: 0.5em; |
| 116 | margin-top: 4.0em; |
| 117 | } |
| 118 | #footer-text { |
| 119 | float: left; |
| 120 | padding-bottom: 0.5em; |
| 121 | } |
| 122 | #footer-badges { |
| 123 | float: right; |
| 124 | padding-bottom: 0.5em; |
| 125 | } |
| 126 | |
| 127 | #preamble { |
| 128 | margin-top: 1.5em; |
| 129 | margin-bottom: 1.5em; |
| 130 | } |
| 131 | div.imageblock, div.exampleblock, div.verseblock, |
| 132 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 133 | div.admonitionblock { |
| 134 | margin-top: 1.0em; |
| 135 | margin-bottom: 1.5em; |
| 136 | } |
| 137 | div.admonitionblock { |
| 138 | margin-top: 2.0em; |
| 139 | margin-bottom: 2.0em; |
| 140 | margin-right: 10%; |
| 141 | color: #606060; |
| 142 | } |
| 143 | |
| 144 | div.content { /* Block element content. */ |
| 145 | padding: 0; |
| 146 | } |
| 147 | |
| 148 | /* Block element titles. */ |
| 149 | div.title, caption.title { |
| 150 | color: #527bbd; |
| 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; |
| 172 | border: 1px solid #dddddd; |
| 173 | border-left: 4px solid #f0f0f0; |
| 174 | padding: 0.5em; |
| 175 | } |
| 176 | |
| 177 | div.listingblock > div.content { |
| 178 | border: 1px solid #dddddd; |
| 179 | border-left: 5px solid #f0f0f0; |
| 180 | background: #f8f8f8; |
| 181 | padding: 0.5em; |
| 182 | } |
| 183 | |
| 184 | div.quoteblock, div.verseblock { |
| 185 | padding-left: 1.0em; |
| 186 | margin-left: 1.0em; |
| 187 | margin-right: 10%; |
| 188 | border-left: 5px solid #f0f0f0; |
| 189 | color: #888; |
| 190 | } |
| 191 | |
| 192 | div.quoteblock > div.attribution { |
| 193 | padding-top: 0.5em; |
| 194 | text-align: right; |
| 195 | } |
| 196 | |
| 197 | div.verseblock > pre.content { |
| 198 | font-family: inherit; |
| 199 | font-size: inherit; |
| 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. */ |
| 206 | div.verseblock + div.attribution { |
| 207 | text-align: left; |
| 208 | } |
| 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; |
| 220 | border-left: 3px solid #dddddd; |
| 221 | } |
| 222 | |
| 223 | div.exampleblock > div.content { |
| 224 | border-left: 3px solid #dddddd; |
| 225 | padding-left: 0.5em; |
| 226 | } |
| 227 | |
| 228 | div.imageblock div.content { padding-left: 0; } |
| 229 | span.image img { border-style: none; vertical-align: text-bottom; } |
| 230 | a.image:visited { color: white; } |
| 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; |
| 239 | font-style: normal; |
| 240 | color: navy; |
| 241 | } |
| 242 | dd > *:first-child { |
| 243 | margin-top: 0.1em; |
| 244 | } |
| 245 | |
| 246 | ul, ol { |
| 247 | list-style-position: outside; |
| 248 | } |
| 249 | ol.arabic { |
| 250 | list-style-type: decimal; |
| 251 | } |
| 252 | ol.loweralpha { |
| 253 | list-style-type: lower-alpha; |
| 254 | } |
| 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 | } |
| 271 | |
| 272 | tfoot { |
| 273 | font-weight: bold; |
| 274 | } |
| 275 | td > div.verse { |
| 276 | white-space: pre; |
| 277 | } |
| 278 | |
| 279 | div.hdlist { |
| 280 | margin-top: 0.8em; |
| 281 | margin-bottom: 0.8em; |
| 282 | } |
| 283 | div.hdlist tr { |
| 284 | padding-bottom: 15px; |
| 285 | } |
| 286 | dt.hdlist1.strong, td.hdlist1.strong { |
| 287 | font-weight: bold; |
| 288 | } |
| 289 | td.hdlist1 { |
| 290 | vertical-align: top; |
| 291 | font-style: normal; |
| 292 | padding-right: 0.8em; |
| 293 | color: navy; |
| 294 | } |
| 295 | td.hdlist2 { |
| 296 | vertical-align: top; |
| 297 | } |
| 298 | div.hdlist.compact tr { |
| 299 | margin: 0; |
| 300 | padding-bottom: 0; |
| 301 | } |
| 302 | |
| 303 | .comment { |
| 304 | background: yellow; |
| 305 | } |
| 306 | |
| 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 | |
| 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; |
| 341 | } |
| 342 | |
| 343 | @media print { |
| 344 | #footer-badges { display: none; } |
| 345 | } |
| 346 | |
| 347 | #toc { |
| 348 | margin-bottom: 2.5em; |
| 349 | } |
| 350 | |
| 351 | #toctitle { |
| 352 | color: #527bbd; |
| 353 | font-size: 1.1em; |
| 354 | font-weight: bold; |
| 355 | margin-top: 1.0em; |
| 356 | margin-bottom: 0.1em; |
| 357 | } |
| 358 | |
| 359 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 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 | } |
| 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 | |
| 417 | div.unbreakable { page-break-inside: avoid; } |
| 418 | |
| 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 | 446e30b | 2014-10-16 21:30:32 | [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 { |
| 522 | padding-top: 0.5em; |
| 523 | padding-bottom: 0.5em; |
| 524 | border-top: 2px solid silver; |
| 525 | border-bottom: 2px solid silver; |
| 526 | } |
| 527 | body.manpage h2 { |
| 528 | border-style: none; |
| 529 | } |
| 530 | body.manpage div.sectionbody { |
| 531 | margin-left: 3em; |
| 532 | } |
| 533 | |
| 534 | @media print { |
| 535 | body.manpage div#toc { display: none; } |
| 536 | } |
| 537 | |
| 538 | |
| 539 | </style> |
| 540 | <script type="text/javascript"> |
| 541 | /*<+'])'); |
| 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 | } |
| 731 | asciidoc.install(); |
| 732 | /*]]>*/ |
| 733 | </script> |
| 734 | </head> |
| 735 | <body class="manpage"> |
| 736 | <div id="header"> |
| 737 | <h1> |
| 738 | giteveryday(7) Manual Page |
| 739 | </h1> |
| 740 | <h2>NAME</h2> |
| 741 | <div class="sectionbody"> |
| 742 | <p>giteveryday - |
| 743 | A useful minimum set of commands for Everyday Git |
| 744 | </p> |
| 745 | </div> |
| 746 | </div> |
| 747 | <div id="content"> |
| 748 | <div class="sect1"> |
| 749 | <h2 id="_synopsis">SYNOPSIS</h2> |
| 750 | <div class="sectionbody"> |
| 751 | <div class="paragraph"><p>Everyday Git With 20 Commands Or So</p></div> |
| 752 | </div> |
| 753 | </div> |
| 754 | <div class="sect1"> |
| 755 | <h2 id="_description">DESCRIPTION</h2> |
| 756 | <div class="sectionbody"> |
| 757 | <div class="paragraph"><p>Git users can broadly be grouped into four categories for the purposes of |
| 758 | describing here a small set of useful command for everyday Git.</p></div> |
| 759 | <div class="ulist"><ul> |
| 760 | <li> |
| 761 | <p> |
| 762 | <a href="#STANDALONE">Individual Developer (Standalone)</a> commands are essential |
| 763 | for anybody who makes a commit, even for somebody who works alone. |
| 764 | </p> |
| 765 | </li> |
| 766 | <li> |
| 767 | <p> |
| 768 | If you work with other people, you will need commands listed in |
| 769 | the <a href="#PARTICIPANT">Individual Developer (Participant)</a> section as well. |
| 770 | </p> |
| 771 | </li> |
| 772 | <li> |
| 773 | <p> |
| 774 | People who play the <a href="#INTEGRATOR">Integrator</a> role need to learn some |
| 775 | more commands in addition to the above. |
| 776 | </p> |
| 777 | </li> |
| 778 | <li> |
| 779 | <p> |
| 780 | <a href="#ADMINISTRATION">Repository Administration</a> commands are for system |
| 781 | administrators who are responsible for the care and feeding |
| 782 | of Git repositories. |
| 783 | </p> |
| 784 | </li> |
| 785 | </ul></div> |
| 786 | </div> |
| 787 | </div> |
| 788 | <div class="sect1"> |
| 789 | <h2 id="_individual_developer_standalone_a_id_standalone_a">Individual Developer (Standalone)<a id="STANDALONE"></a></h2> |
| 790 | <div class="sectionbody"> |
| 791 | <div class="paragraph"><p>A standalone individual developer does not exchange patches with |
| 792 | other people, and works alone in a single repository, using the |
| 793 | following commands.</p></div> |
| 794 | <div class="ulist"><ul> |
| 795 | <li> |
| 796 | <p> |
| 797 | <a href="git-init.html">git-init(1)</a> to create a new repository. |
| 798 | </p> |
| 799 | </li> |
| 800 | <li> |
| 801 | <p> |
| 802 | <a href="git-log.html">git-log(1)</a> to see what happened. |
| 803 | </p> |
| 804 | </li> |
| 805 | <li> |
| 806 | <p> |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 807 | <a href="git-switch.html">git-switch(1)</a> and <a href="git-branch.html">git-branch(1)</a> to switch |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 808 | branches. |
| 809 | </p> |
| 810 | </li> |
| 811 | <li> |
| 812 | <p> |
| 813 | <a href="git-add.html">git-add(1)</a> to manage the index file. |
| 814 | </p> |
| 815 | </li> |
| 816 | <li> |
| 817 | <p> |
| 818 | <a href="git-diff.html">git-diff(1)</a> and <a href="git-status.html">git-status(1)</a> to see what |
| 819 | you are in the middle of doing. |
| 820 | </p> |
| 821 | </li> |
| 822 | <li> |
| 823 | <p> |
| 824 | <a href="git-commit.html">git-commit(1)</a> to advance the current branch. |
| 825 | </p> |
| 826 | </li> |
| 827 | <li> |
| 828 | <p> |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 829 | <a href="git-restore.html">git-restore(1)</a> to undo changes. |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 830 | </p> |
| 831 | </li> |
| 832 | <li> |
| 833 | <p> |
| 834 | <a href="git-merge.html">git-merge(1)</a> to merge between local branches. |
| 835 | </p> |
| 836 | </li> |
| 837 | <li> |
| 838 | <p> |
| 839 | <a href="git-rebase.html">git-rebase(1)</a> to maintain topic branches. |
| 840 | </p> |
| 841 | </li> |
| 842 | <li> |
| 843 | <p> |
| 844 | <a href="git-tag.html">git-tag(1)</a> to mark a known point. |
| 845 | </p> |
| 846 | </li> |
| 847 | </ul></div> |
| 848 | <div class="sect2"> |
| 849 | <h3 id="_examples">Examples</h3> |
| 850 | <div class="dlist"><dl> |
| 851 | <dt class="hdlist1"> |
| 852 | Use a tarball as a starting point for a new repository. |
| 853 | </dt> |
| 854 | <dd> |
| 855 | <div class="listingblock"> |
| 856 | <div class="content"> |
| 857 | <pre><code>$ tar zxf frotz.tar.gz |
| 858 | $ cd frotz |
| 859 | $ git init |
| 860 | $ git add . <b><1></b> |
| 861 | $ git commit -m "import of frotz source tree." |
| 862 | $ git tag v2.43 <b><2></b></code></pre> |
| 863 | </div></div> |
| 864 | <div class="colist arabic"><ol> |
| 865 | <li> |
| 866 | <p> |
| 867 | add everything under the current directory. |
| 868 | </p> |
| 869 | </li> |
| 870 | <li> |
| 871 | <p> |
| 872 | make a lightweight, unannotated tag. |
| 873 | </p> |
| 874 | </li> |
| 875 | </ol></div> |
| 876 | </dd> |
| 877 | <dt class="hdlist1"> |
| 878 | Create a topic branch and develop. |
| 879 | </dt> |
| 880 | <dd> |
| 881 | <div class="listingblock"> |
| 882 | <div class="content"> |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 883 | <pre><code>$ git switch -c alsa-audio <b><1></b> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 884 | $ edit/compile/test |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 885 | $ git restore curses/ux_audio_oss.c <b><2></b> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 886 | $ git add curses/ux_audio_alsa.c <b><3></b> |
| 887 | $ edit/compile/test |
| 888 | $ git diff HEAD <b><4></b> |
| 889 | $ git commit -a -s <b><5></b> |
| 890 | $ edit/compile/test |
| 891 | $ git diff HEAD^ <b><6></b> |
| 892 | $ git commit -a --amend <b><7></b> |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 893 | $ git switch master <b><8></b> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 894 | $ git merge alsa-audio <b><9></b> |
| 895 | $ git log --since='3 days ago' <b><10></b> |
| 896 | $ git log v2.43.. curses/ <b><11></b></code></pre> |
| 897 | </div></div> |
| 898 | <div class="colist arabic"><ol> |
| 899 | <li> |
| 900 | <p> |
| 901 | create a new topic branch. |
| 902 | </p> |
| 903 | </li> |
| 904 | <li> |
| 905 | <p> |
| 906 | revert your botched changes in <code>curses/ux_audio_oss.c</code>. |
| 907 | </p> |
| 908 | </li> |
| 909 | <li> |
| 910 | <p> |
| 911 | you need to tell Git if you added a new file; removal and |
| 912 | modification will be caught if you do <code>git commit -a</code> later. |
| 913 | </p> |
| 914 | </li> |
| 915 | <li> |
| 916 | <p> |
| 917 | to see what changes you are committing. |
| 918 | </p> |
| 919 | </li> |
| 920 | <li> |
| 921 | <p> |
| 922 | commit everything, as you have tested, with your sign-off. |
| 923 | </p> |
| 924 | </li> |
| 925 | <li> |
| 926 | <p> |
| 927 | look at all your changes including the previous commit. |
| 928 | </p> |
| 929 | </li> |
| 930 | <li> |
| 931 | <p> |
| 932 | amend the previous commit, adding all your new changes, |
| 933 | using your original message. |
| 934 | </p> |
| 935 | </li> |
| 936 | <li> |
| 937 | <p> |
| 938 | switch to the master branch. |
| 939 | </p> |
| 940 | </li> |
| 941 | <li> |
| 942 | <p> |
| 943 | merge a topic branch into your master branch. |
| 944 | </p> |
| 945 | </li> |
| 946 | <li> |
| 947 | <p> |
| 948 | review commit logs; other forms to limit output can be |
| 949 | combined and include <code>-10</code> (to show up to 10 commits), |
| 950 | <code>--until=2005-12-10</code>, etc. |
| 951 | </p> |
| 952 | </li> |
| 953 | <li> |
| 954 | <p> |
| 955 | view only the changes that touch what’s in <code>curses/</code> |
| 956 | directory, since <code>v2.43</code> tag. |
| 957 | </p> |
| 958 | </li> |
| 959 | </ol></div> |
| 960 | </dd> |
| 961 | </dl></div> |
| 962 | </div> |
| 963 | </div> |
| 964 | </div> |
| 965 | <div class="sect1"> |
| 966 | <h2 id="_individual_developer_participant_a_id_participant_a">Individual Developer (Participant)<a id="PARTICIPANT"></a></h2> |
| 967 | <div class="sectionbody"> |
| 968 | <div class="paragraph"><p>A developer working as a participant in a group project needs to |
| 969 | learn how to communicate with others, and uses these commands in |
| 970 | addition to the ones needed by a standalone developer.</p></div> |
| 971 | <div class="ulist"><ul> |
| 972 | <li> |
| 973 | <p> |
| 974 | <a href="git-clone.html">git-clone(1)</a> from the upstream to prime your local |
| 975 | repository. |
| 976 | </p> |
| 977 | </li> |
| 978 | <li> |
| 979 | <p> |
| 980 | <a href="git-pull.html">git-pull(1)</a> and <a href="git-fetch.html">git-fetch(1)</a> from "origin" |
| 981 | to keep up-to-date with the upstream. |
| 982 | </p> |
| 983 | </li> |
| 984 | <li> |
| 985 | <p> |
| 986 | <a href="git-push.html">git-push(1)</a> to shared repository, if you adopt CVS |
| 987 | style shared repository workflow. |
| 988 | </p> |
| 989 | </li> |
| 990 | <li> |
| 991 | <p> |
| 992 | <a href="git-format-patch.html">git-format-patch(1)</a> to prepare e-mail submission, if |
| 993 | you adopt Linux kernel-style public forum workflow. |
| 994 | </p> |
| 995 | </li> |
| 996 | <li> |
| 997 | <p> |
| 998 | <a href="git-send-email.html">git-send-email(1)</a> to send your e-mail submission without |
| 999 | corruption by your MUA. |
| 1000 | </p> |
| 1001 | </li> |
| 1002 | <li> |
| 1003 | <p> |
| 1004 | <a href="git-request-pull.html">git-request-pull(1)</a> to create a summary of changes |
| 1005 | for your upstream to pull. |
| 1006 | </p> |
| 1007 | </li> |
| 1008 | </ul></div> |
| 1009 | <div class="sect2"> |
| 1010 | <h3 id="_examples_2">Examples</h3> |
| 1011 | <div class="dlist"><dl> |
| 1012 | <dt class="hdlist1"> |
| 1013 | Clone the upstream and work on it. Feed changes to upstream. |
| 1014 | </dt> |
| 1015 | <dd> |
| 1016 | <div class="listingblock"> |
| 1017 | <div class="content"> |
| 1018 | <pre><code>$ git clone git://git.kernel.org/pub/scm/.../torvalds/linux-2.6 my2.6 |
| 1019 | $ cd my2.6 |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 1020 | $ git switch -c mine master <b><1></b> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1021 | $ edit/compile/test; git commit -a -s <b><2></b> |
| 1022 | $ git format-patch master <b><3></b> |
| 1023 | $ git send-email --to="person <email@example.com>" 00*.patch <b><4></b> |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 1024 | $ git switch master <b><5></b> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1025 | $ git pull <b><6></b> |
| 1026 | $ git log -p ORIG_HEAD.. arch/i386 include/asm-i386 <b><7></b> |
| 1027 | $ git ls-remote --heads http://git.kernel.org/.../jgarzik/libata-dev.git <b><8></b> |
| 1028 | $ git pull git://git.kernel.org/pub/.../jgarzik/libata-dev.git ALL <b><9></b> |
| 1029 | $ git reset --hard ORIG_HEAD <b><10></b> |
| 1030 | $ git gc <b><11></b></code></pre> |
| 1031 | </div></div> |
| 1032 | <div class="colist arabic"><ol> |
| 1033 | <li> |
| 1034 | <p> |
| 1035 | checkout a new branch <code>mine</code> from master. |
| 1036 | </p> |
| 1037 | </li> |
| 1038 | <li> |
| 1039 | <p> |
| 1040 | repeat as needed. |
| 1041 | </p> |
| 1042 | </li> |
| 1043 | <li> |
| 1044 | <p> |
| 1045 | extract patches from your branch, relative to master, |
| 1046 | </p> |
| 1047 | </li> |
| 1048 | <li> |
| 1049 | <p> |
| 1050 | and email them. |
| 1051 | </p> |
| 1052 | </li> |
| 1053 | <li> |
| 1054 | <p> |
| 1055 | return to <code>master</code>, ready to see what’s new |
| 1056 | </p> |
| 1057 | </li> |
| 1058 | <li> |
| 1059 | <p> |
| 1060 | <code>git pull</code> fetches from <code>origin</code> by default and merges into the |
| 1061 | current branch. |
| 1062 | </p> |
| 1063 | </li> |
| 1064 | <li> |
| 1065 | <p> |
| 1066 | immediately after pulling, look at the changes done upstream |
| 1067 | since last time we checked, only in the |
| 1068 | area we are interested in. |
| 1069 | </p> |
| 1070 | </li> |
| 1071 | <li> |
| 1072 | <p> |
| 1073 | check the branch names in an external repository (if not known). |
| 1074 | </p> |
| 1075 | </li> |
| 1076 | <li> |
| 1077 | <p> |
| 1078 | fetch from a specific branch <code>ALL</code> from a specific repository |
| 1079 | and merge it. |
| 1080 | </p> |
| 1081 | </li> |
| 1082 | <li> |
| 1083 | <p> |
| 1084 | revert the pull. |
| 1085 | </p> |
| 1086 | </li> |
| 1087 | <li> |
| 1088 | <p> |
| 1089 | garbage collect leftover objects from reverted pull. |
| 1090 | </p> |
| 1091 | </li> |
| 1092 | </ol></div> |
| 1093 | </dd> |
| 1094 | <dt class="hdlist1"> |
| 1095 | Push into another repository. |
| 1096 | </dt> |
| 1097 | <dd> |
| 1098 | <div class="listingblock"> |
| 1099 | <div class="content"> |
| 1100 | <pre><code>satellite$ git clone mothership:frotz frotz <b><1></b> |
| 1101 | satellite$ cd frotz |
| 1102 | satellite$ git config --get-regexp '^(remote|branch)\.' <b><2></b> |
| 1103 | remote.origin.url mothership:frotz |
| 1104 | remote.origin.fetch refs/heads/*:refs/remotes/origin/* |
| 1105 | branch.master.remote origin |
| 1106 | branch.master.merge refs/heads/master |
| 1107 | satellite$ git config remote.origin.push \ |
| 1108 | +refs/heads/*:refs/remotes/satellite/* <b><3></b> |
| 1109 | satellite$ edit/compile/test/commit |
| 1110 | satellite$ git push origin <b><4></b> |
| 1111 | |
| 1112 | mothership$ cd frotz |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 1113 | mothership$ git switch master |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1114 | mothership$ git merge satellite/master <b><5></b></code></pre> |
| 1115 | </div></div> |
| 1116 | <div class="colist arabic"><ol> |
| 1117 | <li> |
| 1118 | <p> |
| 1119 | mothership machine has a frotz repository under your home |
| 1120 | directory; clone from it to start a repository on the satellite |
| 1121 | machine. |
| 1122 | </p> |
| 1123 | </li> |
| 1124 | <li> |
| 1125 | <p> |
| 1126 | clone sets these configuration variables by default. |
| 1127 | It arranges <code>git pull</code> to fetch and store the branches of mothership |
| 1128 | machine to local <code>remotes/origin/*</code> remote-tracking branches. |
| 1129 | </p> |
| 1130 | </li> |
| 1131 | <li> |
| 1132 | <p> |
| 1133 | arrange <code>git push</code> to push all local branches to |
| 1134 | their corresponding branch of the mothership machine. |
| 1135 | </p> |
| 1136 | </li> |
| 1137 | <li> |
| 1138 | <p> |
| 1139 | push will stash all our work away on <code>remotes/satellite/*</code> |
| 1140 | remote-tracking branches on the mothership machine. You could use this |
| 1141 | as a back-up method. Likewise, you can pretend that mothership |
| 1142 | "fetched" from you (useful when access is one sided). |
| 1143 | </p> |
| 1144 | </li> |
| 1145 | <li> |
| 1146 | <p> |
| 1147 | on mothership machine, merge the work done on the satellite |
| 1148 | machine into the master branch. |
| 1149 | </p> |
| 1150 | </li> |
| 1151 | </ol></div> |
| 1152 | </dd> |
| 1153 | <dt class="hdlist1"> |
| 1154 | Branch off of a specific tag. |
| 1155 | </dt> |
| 1156 | <dd> |
| 1157 | <div class="listingblock"> |
| 1158 | <div class="content"> |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 1159 | <pre><code>$ git switch -c private2.6.14 v2.6.14 <b><1></b> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1160 | $ edit/compile/test; git commit -a |
| 1161 | $ git checkout master |
| 1162 | $ git cherry-pick v2.6.14..private2.6.14 <b><2></b></code></pre> |
| 1163 | </div></div> |
| 1164 | <div class="colist arabic"><ol> |
| 1165 | <li> |
| 1166 | <p> |
| 1167 | create a private branch based on a well known (but somewhat behind) |
| 1168 | tag. |
| 1169 | </p> |
| 1170 | </li> |
| 1171 | <li> |
| 1172 | <p> |
| 1173 | forward port all changes in <code>private2.6.14</code> branch to <code>master</code> branch |
| 1174 | without a formal "merging". Or longhand<br /> |
| 1175 | <code>git format-patch -k -m --stdout v2.6.14..private2.6.14 | |
| 1176 | git am -3 -k</code> |
| 1177 | </p> |
| 1178 | </li> |
| 1179 | </ol></div> |
| 1180 | </dd> |
| 1181 | </dl></div> |
| 1182 | <div class="paragraph"><p>An alternate participant submission mechanism is using the |
| 1183 | <code>git request-pull</code> or pull-request mechanisms (e.g as used on |
| 1184 | GitHub (www.github.com) to notify your upstream of your |
| 1185 | contribution.</p></div> |
| 1186 | </div> |
| 1187 | </div> |
| 1188 | </div> |
| 1189 | <div class="sect1"> |
| 1190 | <h2 id="_integrator_a_id_integrator_a">Integrator<a id="INTEGRATOR"></a></h2> |
| 1191 | <div class="sectionbody"> |
| 1192 | <div class="paragraph"><p>A fairly central person acting as the integrator in a group |
| 1193 | project receives changes made by others, reviews and integrates |
| 1194 | them and publishes the result for others to use, using these |
| 1195 | commands in addition to the ones needed by participants.</p></div> |
| 1196 | <div class="paragraph"><p>This section can also be used by those who respond to <code>git |
| 1197 | request-pull</code> or pull-request on GitHub (www.github.com) to |
Junio C Hamano | ea1ac8d | 2018-07-18 20:16:48 | [diff] [blame] | 1198 | integrate the work of others into their history. A sub-area |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1199 | lieutenant for a repository will act both as a participant and |
| 1200 | as an integrator.</p></div> |
| 1201 | <div class="ulist"><ul> |
| 1202 | <li> |
| 1203 | <p> |
| 1204 | <a href="git-am.html">git-am(1)</a> to apply patches e-mailed in from your |
| 1205 | contributors. |
| 1206 | </p> |
| 1207 | </li> |
| 1208 | <li> |
| 1209 | <p> |
| 1210 | <a href="git-pull.html">git-pull(1)</a> to merge from your trusted lieutenants. |
| 1211 | </p> |
| 1212 | </li> |
| 1213 | <li> |
| 1214 | <p> |
| 1215 | <a href="git-format-patch.html">git-format-patch(1)</a> to prepare and send suggested |
| 1216 | alternative to contributors. |
| 1217 | </p> |
| 1218 | </li> |
| 1219 | <li> |
| 1220 | <p> |
| 1221 | <a href="git-revert.html">git-revert(1)</a> to undo botched commits. |
| 1222 | </p> |
| 1223 | </li> |
| 1224 | <li> |
| 1225 | <p> |
| 1226 | <a href="git-push.html">git-push(1)</a> to publish the bleeding edge. |
| 1227 | </p> |
| 1228 | </li> |
| 1229 | </ul></div> |
| 1230 | <div class="sect2"> |
| 1231 | <h3 id="_examples_3">Examples</h3> |
| 1232 | <div class="dlist"><dl> |
| 1233 | <dt class="hdlist1"> |
| 1234 | A typical integrator’s Git day. |
| 1235 | </dt> |
| 1236 | <dd> |
| 1237 | <div class="listingblock"> |
| 1238 | <div class="content"> |
| 1239 | <pre><code>$ git status <b><1></b> |
| 1240 | $ git branch --no-merged master <b><2></b> |
| 1241 | $ mailx <b><3></b> |
| 1242 | & s 2 3 4 5 ./+to-apply |
| 1243 | & s 7 8 ./+hold-linus |
| 1244 | & q |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 1245 | $ git switch -c topic/one master |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1246 | $ git am -3 -i -s ./+to-apply <b><4></b> |
| 1247 | $ compile/test |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 1248 | $ git switch -c hold/linus && git am -3 -i -s ./+hold-linus <b><5></b> |
| 1249 | $ git switch topic/one && git rebase master <b><6></b> |
Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 1250 | $ git switch -C seen next <b><7></b> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1251 | $ git merge topic/one topic/two && git merge hold/linus <b><8></b> |
Junio C Hamano | c9f11c2 | 2019-07-10 02:54:04 | [diff] [blame] | 1252 | $ git switch maint |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1253 | $ git cherry-pick master~4 <b><9></b> |
| 1254 | $ compile/test |
| 1255 | $ git tag -s -m "GIT 0.99.9x" v0.99.9x <b><10></b> |
Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 1256 | $ git fetch ko && for branch in master maint next seen <b><11></b> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1257 | do |
| 1258 | git show-branch ko/$branch $branch <b><12></b> |
| 1259 | done |
| 1260 | $ git push --follow-tags ko <b><13></b></code></pre> |
| 1261 | </div></div> |
| 1262 | <div class="colist arabic"><ol> |
| 1263 | <li> |
| 1264 | <p> |
| 1265 | see what you were in the middle of doing, if anything. |
| 1266 | </p> |
| 1267 | </li> |
| 1268 | <li> |
| 1269 | <p> |
| 1270 | see which branches haven’t been merged into <code>master</code> yet. |
| 1271 | Likewise for any other integration branches e.g. <code>maint</code>, <code>next</code> |
Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 1272 | and <code>seen</code>. |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1273 | </p> |
| 1274 | </li> |
| 1275 | <li> |
| 1276 | <p> |
| 1277 | read mails, save ones that are applicable, and save others |
| 1278 | that are not quite ready (other mail readers are available). |
| 1279 | </p> |
| 1280 | </li> |
| 1281 | <li> |
| 1282 | <p> |
| 1283 | apply them, interactively, with your sign-offs. |
| 1284 | </p> |
| 1285 | </li> |
| 1286 | <li> |
| 1287 | <p> |
| 1288 | create topic branch as needed and apply, again with sign-offs. |
| 1289 | </p> |
| 1290 | </li> |
| 1291 | <li> |
| 1292 | <p> |
| 1293 | rebase internal topic branch that has not been merged to the |
| 1294 | master or exposed as a part of a stable branch. |
| 1295 | </p> |
| 1296 | </li> |
| 1297 | <li> |
| 1298 | <p> |
Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 1299 | restart <code>seen</code> every time from the next. |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1300 | </p> |
| 1301 | </li> |
| 1302 | <li> |
| 1303 | <p> |
| 1304 | and bundle topic branches still cooking. |
| 1305 | </p> |
| 1306 | </li> |
| 1307 | <li> |
| 1308 | <p> |
| 1309 | backport a critical fix. |
| 1310 | </p> |
| 1311 | </li> |
| 1312 | <li> |
| 1313 | <p> |
| 1314 | create a signed tag. |
| 1315 | </p> |
| 1316 | </li> |
| 1317 | <li> |
| 1318 | <p> |
| 1319 | make sure master was not accidentally rewound beyond that |
Junio C Hamano | dda5d0f | 2017-01-19 23:33:31 | [diff] [blame] | 1320 | already pushed out. |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1321 | </p> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1322 | </li> |
| 1323 | <li> |
| 1324 | <p> |
| 1325 | In the output from <code>git show-branch</code>, <code>master</code> should have |
| 1326 | everything <code>ko/master</code> has, and <code>next</code> should have |
| 1327 | everything <code>ko/next</code> has, etc. |
| 1328 | </p> |
| 1329 | </li> |
| 1330 | <li> |
| 1331 | <p> |
| 1332 | push out the bleeding edge, together with new tags that point |
| 1333 | into the pushed history. |
| 1334 | </p> |
| 1335 | </li> |
| 1336 | </ol></div> |
| 1337 | </dd> |
| 1338 | </dl></div> |
Junio C Hamano | dda5d0f | 2017-01-19 23:33:31 | [diff] [blame] | 1339 | <div class="paragraph"><p>In this example, the <code>ko</code> shorthand points at the Git maintainer’s |
| 1340 | repository at kernel.org, and looks like this:</p></div> |
| 1341 | <div class="listingblock"> |
| 1342 | <div class="content"> |
| 1343 | <pre><code>(in .git/config) |
| 1344 | [remote "ko"] |
| 1345 | url = kernel.org:/pub/scm/git/git.git |
| 1346 | fetch = refs/heads/*:refs/remotes/ko/* |
| 1347 | push = refs/heads/master |
| 1348 | push = refs/heads/next |
Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 1349 | push = +refs/heads/seen |
Junio C Hamano | dda5d0f | 2017-01-19 23:33:31 | [diff] [blame] | 1350 | push = refs/heads/maint</code></pre> |
| 1351 | </div></div> |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1352 | </div> |
| 1353 | </div> |
| 1354 | </div> |
| 1355 | <div class="sect1"> |
| 1356 | <h2 id="_repository_administration_a_id_administration_a">Repository Administration<a id="ADMINISTRATION"></a></h2> |
| 1357 | <div class="sectionbody"> |
| 1358 | <div class="paragraph"><p>A repository administrator uses the following tools to set up |
| 1359 | and maintain access to the repository by developers.</p></div> |
| 1360 | <div class="ulist"><ul> |
| 1361 | <li> |
| 1362 | <p> |
| 1363 | <a href="git-daemon.html">git-daemon(1)</a> to allow anonymous download from |
| 1364 | repository. |
| 1365 | </p> |
| 1366 | </li> |
| 1367 | <li> |
| 1368 | <p> |
| 1369 | <a href="git-shell.html">git-shell(1)</a> can be used as a <em>restricted login shell</em> |
| 1370 | for shared central repository users. |
| 1371 | </p> |
| 1372 | </li> |
| 1373 | <li> |
| 1374 | <p> |
| 1375 | <a href="git-http-backend.html">git-http-backend(1)</a> provides a server side implementation |
| 1376 | of Git-over-HTTP ("Smart http") allowing both fetch and push services. |
| 1377 | </p> |
| 1378 | </li> |
| 1379 | <li> |
| 1380 | <p> |
| 1381 | <a href="gitweb.html">gitweb(1)</a> provides a web front-end to Git repositories, |
| 1382 | which can be set-up using the <a href="git-instaweb.html">git-instaweb(1)</a> script. |
| 1383 | </p> |
| 1384 | </li> |
| 1385 | </ul></div> |
| 1386 | <div class="paragraph"><p><a href="howto/update-hook-example.html">update hook howto</a> has a good |
| 1387 | example of managing a shared central repository.</p></div> |
| 1388 | <div class="paragraph"><p>In addition there are a number of other widely deployed hosting, browsing |
| 1389 | and reviewing solutions such as:</p></div> |
| 1390 | <div class="ulist"><ul> |
| 1391 | <li> |
| 1392 | <p> |
| 1393 | gitolite, gerrit code review, cgit and others. |
| 1394 | </p> |
| 1395 | </li> |
| 1396 | </ul></div> |
| 1397 | <div class="sect2"> |
| 1398 | <h3 id="_examples_4">Examples</h3> |
| 1399 | <div class="dlist"><dl> |
| 1400 | <dt class="hdlist1"> |
| 1401 | We assume the following in /etc/services |
| 1402 | </dt> |
| 1403 | <dd> |
| 1404 | <div class="listingblock"> |
| 1405 | <div class="content"> |
| 1406 | <pre><code>$ grep 9418 /etc/services |
| 1407 | git 9418/tcp # Git Version Control System</code></pre> |
| 1408 | </div></div> |
| 1409 | </dd> |
| 1410 | <dt class="hdlist1"> |
| 1411 | Run git-daemon to serve /pub/scm from inetd. |
| 1412 | </dt> |
| 1413 | <dd> |
| 1414 | <div class="listingblock"> |
| 1415 | <div class="content"> |
| 1416 | <pre><code>$ grep git /etc/inetd.conf |
| 1417 | git stream tcp nowait nobody \ |
| 1418 | /usr/bin/git-daemon git-daemon --inetd --export-all /pub/scm</code></pre> |
| 1419 | </div></div> |
| 1420 | <div class="paragraph"><p>The actual configuration line should be on one line.</p></div> |
| 1421 | </dd> |
| 1422 | <dt class="hdlist1"> |
| 1423 | Run git-daemon to serve /pub/scm from xinetd. |
| 1424 | </dt> |
| 1425 | <dd> |
| 1426 | <div class="listingblock"> |
| 1427 | <div class="content"> |
| 1428 | <pre><code>$ cat /etc/xinetd.d/git-daemon |
| 1429 | # default: off |
| 1430 | # description: The Git server offers access to Git repositories |
| 1431 | service git |
| 1432 | { |
| 1433 | disable = no |
| 1434 | type = UNLISTED |
| 1435 | port = 9418 |
| 1436 | socket_type = stream |
| 1437 | wait = no |
| 1438 | user = nobody |
| 1439 | server = /usr/bin/git-daemon |
| 1440 | server_args = --inetd --export-all --base-path=/pub/scm |
| 1441 | log_on_failure += USERID |
| 1442 | }</code></pre> |
| 1443 | </div></div> |
| 1444 | <div class="paragraph"><p>Check your xinetd(8) documentation and setup, this is from a Fedora system. |
| 1445 | Others might be different.</p></div> |
| 1446 | </dd> |
| 1447 | <dt class="hdlist1"> |
| 1448 | Give push/pull only access to developers using git-over-ssh. |
| 1449 | </dt> |
| 1450 | <dd> |
| 1451 | <p> |
| 1452 | e.g. those using: |
| 1453 | <code>$ git push/pull ssh://host.xz/pub/scm/project</code> |
| 1454 | </p> |
| 1455 | <div class="listingblock"> |
| 1456 | <div class="content"> |
| 1457 | <pre><code>$ grep git /etc/passwd <b><1></b> |
| 1458 | alice:x:1000:1000::/home/alice:/usr/bin/git-shell |
| 1459 | bob:x:1001:1001::/home/bob:/usr/bin/git-shell |
| 1460 | cindy:x:1002:1002::/home/cindy:/usr/bin/git-shell |
| 1461 | david:x:1003:1003::/home/david:/usr/bin/git-shell |
| 1462 | $ grep git /etc/shells <b><2></b> |
| 1463 | /usr/bin/git-shell</code></pre> |
| 1464 | </div></div> |
| 1465 | <div class="colist arabic"><ol> |
| 1466 | <li> |
| 1467 | <p> |
| 1468 | log-in shell is set to /usr/bin/git-shell, which does not |
| 1469 | allow anything but <code>git push</code> and <code>git pull</code>. The users require |
| 1470 | ssh access to the machine. |
| 1471 | </p> |
| 1472 | </li> |
| 1473 | <li> |
| 1474 | <p> |
| 1475 | in many distributions /etc/shells needs to list what is used |
| 1476 | as the login shell. |
| 1477 | </p> |
| 1478 | </li> |
| 1479 | </ol></div> |
| 1480 | </dd> |
| 1481 | <dt class="hdlist1"> |
| 1482 | CVS-style shared repository. |
| 1483 | </dt> |
| 1484 | <dd> |
| 1485 | <div class="listingblock"> |
| 1486 | <div class="content"> |
| 1487 | <pre><code>$ grep git /etc/group <b><1></b> |
| 1488 | git:x:9418:alice,bob,cindy,david |
| 1489 | $ cd /home/devo.git |
| 1490 | $ ls -l <b><2></b> |
| 1491 | lrwxrwxrwx 1 david git 17 Dec 4 22:40 HEAD -> refs/heads/master |
| 1492 | drwxrwsr-x 2 david git 4096 Dec 4 22:40 branches |
| 1493 | -rw-rw-r-- 1 david git 84 Dec 4 22:40 config |
| 1494 | -rw-rw-r-- 1 david git 58 Dec 4 22:40 description |
| 1495 | drwxrwsr-x 2 david git 4096 Dec 4 22:40 hooks |
| 1496 | -rw-rw-r-- 1 david git 37504 Dec 4 22:40 index |
| 1497 | drwxrwsr-x 2 david git 4096 Dec 4 22:40 info |
| 1498 | drwxrwsr-x 4 david git 4096 Dec 4 22:40 objects |
| 1499 | drwxrwsr-x 4 david git 4096 Nov 7 14:58 refs |
| 1500 | drwxrwsr-x 2 david git 4096 Dec 4 22:40 remotes |
| 1501 | $ ls -l hooks/update <b><3></b> |
| 1502 | -r-xr-xr-x 1 david git 3536 Dec 4 22:40 update |
| 1503 | $ cat info/allowed-users <b><4></b> |
| 1504 | refs/heads/master alice\|cindy |
| 1505 | refs/heads/doc-update bob |
| 1506 | refs/tags/v[0-9]* david</code></pre> |
| 1507 | </div></div> |
| 1508 | <div class="colist arabic"><ol> |
| 1509 | <li> |
| 1510 | <p> |
| 1511 | place the developers into the same git group. |
| 1512 | </p> |
| 1513 | </li> |
| 1514 | <li> |
| 1515 | <p> |
| 1516 | and make the shared repository writable by the group. |
| 1517 | </p> |
| 1518 | </li> |
| 1519 | <li> |
| 1520 | <p> |
| 1521 | use update-hook example by Carl from Documentation/howto/ |
| 1522 | for branch policy control. |
| 1523 | </p> |
| 1524 | </li> |
| 1525 | <li> |
| 1526 | <p> |
| 1527 | alice and cindy can push into master, only bob can push into doc-update. |
| 1528 | david is the release manager and is the only person who can |
| 1529 | create and push version tags. |
| 1530 | </p> |
| 1531 | </li> |
| 1532 | </ol></div> |
| 1533 | </dd> |
| 1534 | </dl></div> |
| 1535 | </div> |
| 1536 | </div> |
| 1537 | </div> |
| 1538 | <div class="sect1"> |
| 1539 | <h2 id="_git">GIT</h2> |
| 1540 | <div class="sectionbody"> |
| 1541 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
| 1542 | </div> |
| 1543 | </div> |
| 1544 | </div> |
| 1545 | <div id="footnotes"><hr /></div> |
| 1546 | <div id="footer"> |
| 1547 | <div id="footer-text"> |
Junio C Hamano | 2ef0ba3 | 2018-01-26 23:13:53 | [diff] [blame] | 1548 | Last updated |
Junio C Hamano | a891178 | 2020-07-07 05:35:57 | [diff] [blame] | 1549 | 2020-07-06 22:33:22 PDT |
Junio C Hamano | 446e30b | 2014-10-16 21:30:32 | [diff] [blame] | 1550 | </div> |
| 1551 | </div> |
| 1552 | </body> |
| 1553 | </html> |