| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.5.2" /> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 7 | <title>git-checkout(1)</title> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 8 | <style type="text/css"> |
| 9 | /* Debug borders */ |
| 10 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 11 | /* |
| 12 | border: 1px solid red; |
| 13 | */ |
| 14 | } |
| 15 | |
| 16 | body { |
| 17 | margin: 1em 5% 1em 5%; |
| 18 | } |
| 19 | |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 20 | a { |
| 21 | color: blue; |
| 22 | text-decoration: underline; |
| 23 | } |
| 24 | a:visited { |
| 25 | color: fuchsia; |
| 26 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 27 | |
| 28 | em { |
| 29 | font-style: italic; |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 30 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | strong { |
| 34 | font-weight: bold; |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 35 | color: #083194; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | tt { |
| 39 | color: navy; |
| 40 | } |
| 41 | |
| 42 | h1, h2, h3, h4, h5, h6 { |
| 43 | color: #527bbd; |
| 44 | font-family: sans-serif; |
| 45 | margin-top: 1.2em; |
| 46 | margin-bottom: 0.5em; |
| 47 | line-height: 1.3; |
| 48 | } |
| 49 | |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 50 | h1, h2, h3 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 51 | border-bottom: 2px solid silver; |
| 52 | } |
| 53 | h2 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 54 | padding-top: 0.5em; |
| 55 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 56 | h3 { |
| 57 | float: left; |
| 58 | } |
| 59 | h3 + * { |
| 60 | clear: left; |
| 61 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 62 | |
| 63 | div.sectionbody { |
| 64 | font-family: serif; |
| 65 | margin-left: 0; |
| 66 | } |
| 67 | |
| 68 | hr { |
| 69 | border: 1px solid silver; |
| 70 | } |
| 71 | |
| 72 | p { |
| 73 | margin-top: 0.5em; |
| 74 | margin-bottom: 0.5em; |
| 75 | } |
| 76 | |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 77 | ul, ol, li > p { |
| 78 | margin-top: 0; |
| 79 | } |
| 80 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 81 | pre { |
| 82 | padding: 0; |
| 83 | margin: 0; |
| 84 | } |
| 85 | |
| 86 | span#author { |
| 87 | color: #527bbd; |
| 88 | font-family: sans-serif; |
| 89 | font-weight: bold; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 90 | font-size: 1.1em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 91 | } |
| 92 | span#email { |
| 93 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 94 | span#revnumber, span#revdate, span#revremark { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 95 | font-family: sans-serif; |
| 96 | } |
| 97 | |
| 98 | div#footer { |
| 99 | font-family: sans-serif; |
| 100 | font-size: small; |
| 101 | border-top: 2px solid silver; |
| 102 | padding-top: 0.5em; |
| 103 | margin-top: 4.0em; |
| 104 | } |
| 105 | div#footer-text { |
| 106 | float: left; |
| 107 | padding-bottom: 0.5em; |
| 108 | } |
| 109 | div#footer-badges { |
| 110 | float: right; |
| 111 | padding-bottom: 0.5em; |
| 112 | } |
| 113 | |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 114 | div#preamble { |
| 115 | margin-top: 1.5em; |
| 116 | margin-bottom: 1.5em; |
| 117 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 118 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 119 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 120 | div.admonitionblock { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 121 | margin-top: 1.0em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 122 | margin-bottom: 1.5em; |
| 123 | } |
| 124 | div.admonitionblock { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 125 | margin-top: 2.0em; |
| 126 | margin-bottom: 2.0em; |
| 127 | margin-right: 10%; |
| 128 | color: #606060; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | div.content { /* Block element content. */ |
| 132 | padding: 0; |
| 133 | } |
| 134 | |
| 135 | /* Block element titles. */ |
| 136 | div.title, caption.title { |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 137 | color: #527bbd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 138 | font-family: sans-serif; |
| 139 | font-weight: bold; |
| 140 | text-align: left; |
| 141 | margin-top: 1.0em; |
| 142 | margin-bottom: 0.5em; |
| 143 | } |
| 144 | div.title + * { |
| 145 | margin-top: 0; |
| 146 | } |
| 147 | |
| 148 | td div.title:first-child { |
| 149 | margin-top: 0.0em; |
| 150 | } |
| 151 | div.content div.title:first-child { |
| 152 | margin-top: 0.0em; |
| 153 | } |
| 154 | div.content + div.title { |
| 155 | margin-top: 0.0em; |
| 156 | } |
| 157 | |
| 158 | div.sidebarblock > div.content { |
| 159 | background: #ffffee; |
| 160 | border: 1px solid silver; |
| 161 | padding: 0.5em; |
| 162 | } |
| 163 | |
| 164 | div.listingblock > div.content { |
| 165 | border: 1px solid silver; |
| 166 | background: #f4f4f4; |
| 167 | padding: 0.5em; |
| 168 | } |
| 169 | |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 170 | div.quoteblock, div.verseblock { |
| 171 | padding-left: 1.0em; |
| 172 | margin-left: 1.0em; |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 173 | margin-right: 10%; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 174 | border-left: 5px solid #dddddd; |
| 175 | color: #777777; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 176 | } |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 177 | |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 178 | div.quoteblock > div.attribution { |
| 179 | padding-top: 0.5em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 180 | text-align: right; |
| 181 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 182 | |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 183 | div.verseblock > div.content { |
| 184 | white-space: pre; |
| 185 | } |
| 186 | div.verseblock > div.attribution { |
| 187 | padding-top: 0.75em; |
| 188 | text-align: left; |
| 189 | } |
| 190 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 191 | div.verseblock + div.attribution { |
| 192 | text-align: left; |
| 193 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 194 | |
| 195 | div.admonitionblock .icon { |
| 196 | vertical-align: top; |
| 197 | font-size: 1.1em; |
| 198 | font-weight: bold; |
| 199 | text-decoration: underline; |
| 200 | color: #527bbd; |
| 201 | padding-right: 0.5em; |
| 202 | } |
| 203 | div.admonitionblock td.content { |
| 204 | padding-left: 0.5em; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 205 | border-left: 3px solid #dddddd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | div.exampleblock > div.content { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 209 | border-left: 3px solid #dddddd; |
| 210 | padding-left: 0.5em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 211 | } |
| 212 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 213 | div.imageblock div.content { padding-left: 0; } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 214 | span.image img { border-style: none; } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 215 | a.image:visited { color: white; } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 216 | |
| 217 | dl { |
| 218 | margin-top: 0.8em; |
| 219 | margin-bottom: 0.8em; |
| 220 | } |
| 221 | dt { |
| 222 | margin-top: 0.5em; |
| 223 | margin-bottom: 0; |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 224 | font-style: normal; |
| 225 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 226 | } |
| 227 | dd > *:first-child { |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 228 | margin-top: 0.1em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | ul, ol { |
| 232 | list-style-position: outside; |
| 233 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 234 | ol.arabic { |
| 235 | list-style-type: decimal; |
| 236 | } |
| 237 | ol.loweralpha { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 238 | list-style-type: lower-alpha; |
| 239 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 240 | ol.upperalpha { |
| 241 | list-style-type: upper-alpha; |
| 242 | } |
| 243 | ol.lowerroman { |
| 244 | list-style-type: lower-roman; |
| 245 | } |
| 246 | ol.upperroman { |
| 247 | list-style-type: upper-roman; |
| 248 | } |
| 249 | |
| 250 | div.compact ul, div.compact ol, |
| 251 | div.compact p, div.compact p, |
| 252 | div.compact div, div.compact div { |
| 253 | margin-top: 0.1em; |
| 254 | margin-bottom: 0.1em; |
| 255 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 256 | |
| 257 | div.tableblock > table { |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 258 | border: 3px solid #527bbd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 259 | } |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 260 | thead, p.table.header { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 261 | font-family: sans-serif; |
| 262 | font-weight: bold; |
| 263 | } |
| 264 | tfoot { |
| 265 | font-weight: bold; |
| 266 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 267 | td > div.verse { |
| 268 | white-space: pre; |
| 269 | } |
| 270 | p.table { |
| 271 | margin-top: 0; |
| 272 | } |
| 273 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 274 | div.tableblock > table[frame="void"] { |
| 275 | border-style: none; |
| 276 | } |
| 277 | div.tableblock > table[frame="hsides"] { |
| 278 | border-left-style: none; |
| 279 | border-right-style: none; |
| 280 | } |
| 281 | div.tableblock > table[frame="vsides"] { |
| 282 | border-top-style: none; |
| 283 | border-bottom-style: none; |
| 284 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 285 | |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 286 | |
| 287 | div.hdlist { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 288 | margin-top: 0.8em; |
| 289 | margin-bottom: 0.8em; |
| 290 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 291 | div.hdlist tr { |
| 292 | padding-bottom: 15px; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 293 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 294 | dt.hdlist1.strong, td.hdlist1.strong { |
| 295 | font-weight: bold; |
| 296 | } |
| 297 | td.hdlist1 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 298 | vertical-align: top; |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 299 | font-style: normal; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 300 | padding-right: 0.8em; |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 301 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 302 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 303 | td.hdlist2 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 304 | vertical-align: top; |
| 305 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 306 | div.hdlist.compact tr { |
| 307 | margin: 0; |
| 308 | padding-bottom: 0; |
| 309 | } |
| 310 | |
| 311 | .comment { |
| 312 | background: yellow; |
| 313 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 314 | |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 315 | .footnote, .footnoteref { |
| 316 | font-size: 0.8em; |
| 317 | } |
| 318 | |
| 319 | span.footnote, span.footnoteref { |
| 320 | vertical-align: super; |
| 321 | } |
| 322 | |
| 323 | #footnotes { |
| 324 | margin: 20px 0 20px 0; |
| 325 | padding: 7px 0 0 0; |
| 326 | } |
| 327 | |
| 328 | #footnotes div.footnote { |
| 329 | margin: 0 0 5px 0; |
| 330 | } |
| 331 | |
| 332 | #footnotes hr { |
| 333 | border: none; |
| 334 | border-top: 1px solid silver; |
| 335 | height: 1px; |
| 336 | text-align: left; |
| 337 | margin-left: 0; |
| 338 | width: 20%; |
| 339 | min-width: 100px; |
| 340 | } |
| 341 | |
| 342 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 343 | @media print { |
| 344 | div#footer-badges { display: none; } |
| 345 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 346 | |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 347 | div#toc { |
| 348 | margin-bottom: 2.5em; |
| 349 | } |
| 350 | |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 351 | div#toctitle { |
| 352 | color: #527bbd; |
| 353 | font-family: sans-serif; |
| 354 | font-size: 1.1em; |
| 355 | font-weight: bold; |
| 356 | margin-top: 1.0em; |
| 357 | margin-bottom: 0.1em; |
| 358 | } |
| 359 | |
| 360 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 361 | margin-top: 0; |
| 362 | margin-bottom: 0; |
| 363 | } |
| 364 | div.toclevel2 { |
| 365 | margin-left: 2em; |
| 366 | font-size: 0.9em; |
| 367 | } |
| 368 | div.toclevel3 { |
| 369 | margin-left: 4em; |
| 370 | font-size: 0.9em; |
| 371 | } |
| 372 | div.toclevel4 { |
| 373 | margin-left: 6em; |
| 374 | font-size: 0.9em; |
| 375 | } |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 376 | /* Overrides for manpage documents */ |
| 377 | h1 { |
| 378 | padding-top: 0.5em; |
| 379 | padding-bottom: 0.5em; |
| 380 | border-top: 2px solid silver; |
| 381 | border-bottom: 2px solid silver; |
| 382 | } |
| 383 | h2 { |
| 384 | border-style: none; |
| 385 | } |
| 386 | div.sectionbody { |
| 387 | margin-left: 5%; |
| 388 | } |
| 389 | |
| 390 | @media print { |
| 391 | div#toc { display: none; } |
| 392 | } |
| 393 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 394 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 395 | |
| 396 | div.sidebar-content { |
| 397 | background: #ffffee; |
| 398 | border: 1px solid silver; |
| 399 | padding: 0.5em; |
| 400 | } |
| 401 | div.sidebar-title, div.image-title { |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 402 | color: #527bbd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 403 | font-family: sans-serif; |
| 404 | font-weight: bold; |
| 405 | margin-top: 0.0em; |
| 406 | margin-bottom: 0.5em; |
| 407 | } |
| 408 | |
| 409 | div.listingblock div.content { |
| 410 | border: 1px solid silver; |
| 411 | background: #f4f4f4; |
| 412 | padding: 0.5em; |
| 413 | } |
| 414 | |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 415 | div.quoteblock-attribution { |
| 416 | padding-top: 0.5em; |
| 417 | text-align: right; |
| 418 | } |
| 419 | |
| 420 | div.verseblock-content { |
| 421 | white-space: pre; |
| 422 | } |
| 423 | div.verseblock-attribution { |
| 424 | padding-top: 0.75em; |
| 425 | text-align: left; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 426 | } |
| 427 | |
| 428 | div.exampleblock-content { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 429 | border-left: 3px solid #dddddd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 430 | padding-left: 0.5em; |
| 431 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 432 | |
| 433 | /* IE6 sets dynamically generated links as visited. */ |
| 434 | div#toc a:visited { color: blue; } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 435 | </style> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 436 | <script type="text/javascript"> |
| 437 | /*<+'])'); |
| 481 | // Function that scans the DOM tree for header elements (the DOM2 |
| 482 | // nodeIterator API would be a better technique but not supported by all |
| 483 | // browsers). |
| 484 | var iterate = function (el) { |
| 485 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 486 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 487 | var mo = re.exec(i.tagName); |
| 488 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 489 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 490 | } |
| 491 | iterate(i); |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | iterate(el); |
| 496 | return result; |
| 497 | } |
| 498 | |
| 499 | var toc = document.getElementById("toc"); |
| 500 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 501 | for (var i = 0; i < entries.length; ++i) { |
| 502 | var entry = entries[i]; |
| 503 | if (entry.element.id == "") |
| 504 | entry.element.id = "_toc_" + i; |
| 505 | var a = document.createElement("a"); |
| 506 | a.href = "#" + entry.element.id; |
| 507 | a.appendChild(document.createTextNode(entry.text)); |
| 508 | var div = document.createElement("div"); |
| 509 | div.appendChild(a); |
| 510 | div.className = "toclevel" + entry.toclevel; |
| 511 | toc.appendChild(div); |
| 512 | } |
| 513 | if (entries.length == 0) |
| 514 | toc.parentNode.removeChild(toc); |
| 515 | }, |
| 516 | |
| 517 | |
| 518 | ///////////////////////////////////////////////////////////////////// |
| 519 | // Footnotes generator |
| 520 | ///////////////////////////////////////////////////////////////////// |
| 521 | |
| 522 | /* Based on footnote generation code from: |
| 523 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 524 | */ |
| 525 | |
| 526 | footnotes: function () { |
| 527 | var cont = document.getElementById("content"); |
| 528 | var noteholder = document.getElementById("footnotes"); |
| 529 | var spans = cont.getElementsByTagName("span"); |
| 530 | var refs = {}; |
| 531 | var n = 0; |
| 532 | for (i=0; i<spans.length; i++) { |
| 533 | if (spans[i].className == "footnote") { |
| 534 | n++; |
| 535 | // Use [\s\S] in place of . so multi-line matches work. |
| 536 | // Because JavaScript has no s (dotall) regex flag. |
| 537 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 538 | noteholder.innerHTML += |
| 539 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 540 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 541 | n + "</a>. " + note + "</div>"; |
| 542 | spans[i].innerHTML = |
| 543 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 544 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 545 | var id =spans[i].getAttribute("id"); |
| 546 | if (id != null) refs["#"+id] = n; |
| 547 | } |
| 548 | } |
| 549 | if (n == 0) |
| 550 | noteholder.parentNode.removeChild(noteholder); |
| 551 | else { |
| 552 | // Process footnoterefs. |
| 553 | for (i=0; i<spans.length; i++) { |
| 554 | if (spans[i].className == "footnoteref") { |
| 555 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 556 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 557 | n = refs[href]; |
| 558 | spans[i].innerHTML = |
| 559 | "[<a href='#_footnote_" + n + |
| 560 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 561 | } |
| 562 | } |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | } |
| 567 | /*]]>*/ |
| 568 | </script> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 569 | </head> |
| 570 | <body> |
| 571 | <div id="header"> |
| 572 | <h1> |
| 573 | git-checkout(1) Manual Page |
| 574 | </h1> |
| 575 | <h2>NAME</h2> |
| 576 | <div class="sectionbody"> |
| 577 | <p>git-checkout - |
| Junio C Hamano | a14a403 | 2008-03-25 09:11:02 | [diff] [blame] | 578 | Checkout a branch or paths to the working tree |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 579 | </p> |
| 580 | </div> |
| 581 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 582 | <div id="content"> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 583 | <h2 id="_synopsis">SYNOPSIS</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 584 | <div class="sectionbody"> |
| Junio C Hamano | 2b13527 | 2006-03-18 07:45:42 | [diff] [blame] | 585 | <div class="verseblock"> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 586 | <div class="verseblock-content"><em>git checkout</em> [-q] [-f] [-m] [<branch>] |
| Junio C Hamano | 63c2bc9 | 2011-02-28 06:41:28 | [diff] [blame] | 587 | <em>git checkout</em> [-q] [-f] [-m] [--detach] [<commit>] |
| Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 588 | <em>git checkout</em> [-q] [-f] [-m] [[-b|-B|--orphan] <new_branch>] [<start_point>] |
| Junio C Hamano | c28068f | 2009-09-08 00:55:23 | [diff] [blame] | 589 | <em>git checkout</em> [-f|--ours|--theirs|-m|--conflict=<style>] [<tree-ish>] [--] <paths>… |
| Junio C Hamano | 9eb5835 | 2011-05-11 20:09:24 | [diff] [blame] | 590 | <em>git checkout</em> [-p|--patch] [<tree-ish>] [--] [<paths>…]</div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 591 | <div class="verseblock-attribution"> |
| 592 | </div></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 593 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 594 | <h2 id="_description">DESCRIPTION</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 595 | <div class="sectionbody"> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 596 | <div class="paragraph"><p>Updates files in the working tree to match the version in the index |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 597 | or the specified tree. If no paths are given, <em>git checkout</em> will |
| 598 | also update <tt>HEAD</tt> to set the specified branch as the current |
| Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 599 | branch.</p></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 600 | <div class="dlist"><dl> |
| 601 | <dt class="hdlist1"> |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 602 | <em>git checkout</em> [<branch>] |
| 603 | </dt> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 604 | <dt class="hdlist1"> |
| Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 605 | <em>git checkout</em> -b|-B <new_branch> [<start point>] |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 606 | </dt> |
| Junio C Hamano | 63c2bc9 | 2011-02-28 06:41:28 | [diff] [blame] | 607 | <dt class="hdlist1"> |
| 608 | <em>git checkout</em> [--detach] [<commit>] |
| 609 | </dt> |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 610 | <dd> |
| 611 | <p> |
| 612 | This form switches branches by updating the index, working |
| Junio C Hamano | 63c2bc9 | 2011-02-28 06:41:28 | [diff] [blame] | 613 | tree, and HEAD to reflect the specified branch or commit. |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 614 | </p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 615 | <div class="paragraph"><p>If <tt>-b</tt> is given, a new branch is created as if <a href="git-branch.html">git-branch(1)</a> |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 616 | were called and then checked out; in this case you can |
| 617 | use the <tt>--track</tt> or <tt>--no-track</tt> options, which will be passed to |
| 618 | <em>git branch</em>. As a convenience, <tt>--track</tt> without <tt>-b</tt> implies branch |
| 619 | creation; see the description of <tt>--track</tt> below.</p></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 620 | <div class="paragraph"><p>If <tt>-B</tt> is given, <new_branch> is created if it doesn’t exist; otherwise, it |
| Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 621 | is reset. This is the transactional equivalent of</p></div> |
| 622 | <div class="listingblock"> |
| 623 | <div class="content"> |
| 624 | <pre><tt>$ git branch -f <branch> [<start point>] |
| 625 | $ git checkout <branch></tt></pre> |
| 626 | </div></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 627 | <div class="paragraph"><p>that is to say, the branch is not reset/created unless "git checkout" is |
| Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 628 | successful.</p></div> |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 629 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 630 | <dt class="hdlist1"> |
| Junio C Hamano | 9eb5835 | 2011-05-11 20:09:24 | [diff] [blame] | 631 | <em>git checkout</em> [-p|--patch] [<tree-ish>] [--] <pathspec>… |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 632 | </dt> |
| 633 | <dd> |
| 634 | <p> |
| Junio C Hamano | 442206c | 2010-09-28 05:51:23 | [diff] [blame] | 635 | When <paths> or <tt>--patch</tt> are given, <em>git checkout</em> does <strong>not</strong> |
| 636 | switch branches. It updates the named paths in the working tree |
| 637 | from the index file or from a named <tree-ish> (most often a |
| 638 | commit). In this case, the <tt>-b</tt> and <tt>--track</tt> options are |
| 639 | meaningless and giving either of them results in an error. The |
| 640 | <tree-ish> argument can be used to specify a specific tree-ish |
| 641 | (i.e. commit, tag or tree) to update the index for the given |
| 642 | paths before updating the working tree. |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 643 | </p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 644 | <div class="paragraph"><p>The index may contain unmerged entries because of a previous failed merge. |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 645 | By default, if you try to check out such an entry from the index, the |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 646 | checkout operation will fail and nothing will be checked out. |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 647 | Using <tt>-f</tt> will ignore these unmerged entries. The contents from a |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 648 | specific side of the merge can be checked out of the index by |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 649 | using <tt>--ours</tt> or <tt>--theirs</tt>. With <tt>-m</tt>, changes made to the working tree |
| 650 | file can be discarded to re-create the original conflicted merge result.</p></div> |
| 651 | </dd> |
| 652 | </dl></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 653 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 654 | <h2 id="_options">OPTIONS</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 655 | <div class="sectionbody"> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 656 | <div class="dlist"><dl> |
| 657 | <dt class="hdlist1"> |
| Junio C Hamano | 39381a7 | 2007-02-02 07:35:15 | [diff] [blame] | 658 | -q |
| 659 | </dt> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 660 | <dt class="hdlist1"> |
| Junio C Hamano | 68cfa3a | 2009-08-30 00:22:55 | [diff] [blame] | 661 | --quiet |
| 662 | </dt> |
| Junio C Hamano | 39381a7 | 2007-02-02 07:35:15 | [diff] [blame] | 663 | <dd> |
| 664 | <p> |
| Junio C Hamano | cae8627 | 2007-08-21 02:20:49 | [diff] [blame] | 665 | Quiet, suppress feedback messages. |
| Junio C Hamano | 39381a7 | 2007-02-02 07:35:15 | [diff] [blame] | 666 | </p> |
| 667 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 668 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 669 | -f |
| 670 | </dt> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 671 | <dt class="hdlist1"> |
| Junio C Hamano | 68cfa3a | 2009-08-30 00:22:55 | [diff] [blame] | 672 | --force |
| 673 | </dt> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 674 | <dd> |
| 675 | <p> |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 676 | When switching branches, proceed even if the index or the |
| 677 | working tree differs from HEAD. This is used to throw away |
| 678 | local changes. |
| 679 | </p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 680 | <div class="paragraph"><p>When checking out paths from the index, do not fail upon unmerged |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 681 | entries; instead, unmerged entries are ignored.</p></div> |
| 682 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 683 | <dt class="hdlist1"> |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 684 | --ours |
| 685 | </dt> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 686 | <dt class="hdlist1"> |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 687 | --theirs |
| 688 | </dt> |
| 689 | <dd> |
| 690 | <p> |
| 691 | When checking out paths from the index, check out stage #2 |
| 692 | (<em>ours</em>) or #3 (<em>theirs</em>) for unmerged paths. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 693 | </p> |
| 694 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 695 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 696 | -b |
| 697 | </dt> |
| 698 | <dd> |
| 699 | <p> |
| Junio C Hamano | b2f5edd | 2006-05-21 10:50:09 | [diff] [blame] | 700 | Create a new branch named <new_branch> and start it at |
| Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 701 | <start_point>; see <a href="git-branch.html">git-branch(1)</a> for details. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 702 | </p> |
| 703 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 704 | <dt class="hdlist1"> |
| Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 705 | -B |
| 706 | </dt> |
| 707 | <dd> |
| 708 | <p> |
| 709 | Creates the branch <new_branch> and start it at <start_point>; |
| 710 | if it already exists, then reset it to <start_point>. This is |
| 711 | equivalent to running "git branch" with "-f"; see |
| 712 | <a href="git-branch.html">git-branch(1)</a> for details. |
| 713 | </p> |
| 714 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 715 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 716 | -t |
| 717 | </dt> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 718 | <dt class="hdlist1"> |
| Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 719 | --track |
| Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 720 | </dt> |
| 721 | <dd> |
| 722 | <p> |
| Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 723 | When creating a new branch, set up "upstream" configuration. See |
| 724 | "--track" in <a href="git-branch.html">git-branch(1)</a> for details. |
| Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 725 | </p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 726 | <div class="paragraph"><p>If no <em>-b</em> option is given, the name of the new branch will be |
| 727 | derived from the remote-tracking branch. If "remotes/" or "refs/remotes/" |
| Junio C Hamano | 5705393 | 2009-03-11 08:48:32 | [diff] [blame] | 728 | is prefixed it is stripped away, and then the part up to the |
| Junio C Hamano | 043628e | 2008-08-24 03:34:11 | [diff] [blame] | 729 | next slash (which would be the nickname of the remote) is removed. |
| 730 | This would tell us to use "hack" as the local branch when branching |
| 731 | off of "origin/hack" (or "remotes/origin/hack", or even |
| 732 | "refs/remotes/origin/hack"). If the given name has no slash, or the above |
| 733 | guessing results in an empty name, the guessing is aborted. You can |
| Junio C Hamano | 7d06a8a | 2008-10-20 05:42:33 | [diff] [blame] | 734 | explicitly give a name with <em>-b</em> in such a case.</p></div> |
| Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 735 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 736 | <dt class="hdlist1"> |
| Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 737 | --no-track |
| 738 | </dt> |
| 739 | <dd> |
| 740 | <p> |
| Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 741 | Do not set up "upstream" configuration, even if the |
| 742 | branch.autosetupmerge configuration variable is true. |
| Junio C Hamano | 103ad7f | 2007-03-14 11:19:26 | [diff] [blame] | 743 | </p> |
| 744 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 745 | <dt class="hdlist1"> |
| Junio C Hamano | 341071d | 2006-06-04 07:24:48 | [diff] [blame] | 746 | -l |
| 747 | </dt> |
| 748 | <dd> |
| 749 | <p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 750 | Create the new branch’s reflog; see <a href="git-branch.html">git-branch(1)</a> for |
| Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 751 | details. |
| Junio C Hamano | 341071d | 2006-06-04 07:24:48 | [diff] [blame] | 752 | </p> |
| 753 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 754 | <dt class="hdlist1"> |
| Junio C Hamano | 63c2bc9 | 2011-02-28 06:41:28 | [diff] [blame] | 755 | --detach |
| 756 | </dt> |
| 757 | <dd> |
| 758 | <p> |
| 759 | Rather than checking out a branch to work on it, check out a |
| 760 | commit for inspection and discardable experiments. |
| 761 | This is the default behavior of "git checkout <commit>" when |
| 762 | <commit> is not a branch name. See the "DETACHED HEAD" section |
| 763 | below for details. |
| 764 | </p> |
| 765 | </dd> |
| 766 | <dt class="hdlist1"> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 767 | --orphan |
| 768 | </dt> |
| 769 | <dd> |
| 770 | <p> |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 771 | Create a new <em>orphan</em> branch, named <new_branch>, started from |
| 772 | <start_point> and switch to it. The first commit made on this |
| 773 | new branch will have no parents and it will be the root of a new |
| 774 | history totally disconnected from all the other branches and |
| 775 | commits. |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 776 | </p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 777 | <div class="paragraph"><p>The index and the working tree are adjusted as if you had previously run |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 778 | "git checkout <start_point>". This allows you to start a new history |
| 779 | that records a set of paths similar to <start_point> by easily running |
| 780 | "git commit -a" to make the root commit.</p></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 781 | <div class="paragraph"><p>This can be useful when you want to publish the tree from a commit |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 782 | without exposing its full history. You might want to do this to publish |
| 783 | an open source branch of a project whose current tree is "clean", but |
| 784 | whose full history contains proprietary or otherwise encumbered bits of |
| 785 | code.</p></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 786 | <div class="paragraph"><p>If you want to start a disconnected history that records a set of paths |
| Junio C Hamano | bb88cf4 | 2010-06-21 15:23:55 | [diff] [blame] | 787 | that is totally different from the one of <start_point>, then you should |
| 788 | clear the index and the working tree right after creating the orphan |
| 789 | branch by running "git rm -rf ." from the top level of the working tree. |
| 790 | Afterwards you will be ready to prepare your new files, repopulating the |
| 791 | working tree, by copying them from elsewhere, extracting a tarball, etc.</p></div> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 792 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 793 | <dt class="hdlist1"> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 794 | -m |
| 795 | </dt> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 796 | <dt class="hdlist1"> |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 797 | --merge |
| 798 | </dt> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 799 | <dd> |
| 800 | <p> |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 801 | When switching branches, |
| 802 | if you have local modifications to one or more files that |
| Junio C Hamano | 2b13527 | 2006-03-18 07:45:42 | [diff] [blame] | 803 | are different between the current branch and the branch to |
| 804 | which you are switching, the command refuses to switch |
| 805 | branches in order to preserve your modifications in context. |
| 806 | However, with this option, a three-way merge between the current |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 807 | branch, your working tree contents, and the new branch |
| 808 | is done, and you will be on the new branch. |
| 809 | </p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 810 | <div class="paragraph"><p>When a merge conflict happens, the index entries for conflicting |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 811 | paths are left unmerged, and you need to resolve the conflicts |
| Junio C Hamano | 89d4e0f | 2007-02-18 00:34:59 | [diff] [blame] | 812 | and mark the resolved paths with <tt>git add</tt> (or <tt>git rm</tt> if the merge |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 813 | should result in deletion of the path).</p></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 814 | <div class="paragraph"><p>When checking out paths from the index, this option lets you recreate |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 815 | the conflicted merge in the specified paths.</p></div> |
| 816 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 817 | <dt class="hdlist1"> |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 818 | --conflict=<style> |
| 819 | </dt> |
| 820 | <dd> |
| 821 | <p> |
| 822 | The same as --merge option above, but changes the way the |
| 823 | conflicting hunks are presented, overriding the |
| 824 | merge.conflictstyle configuration variable. Possible values are |
| 825 | "merge" (default) and "diff3" (in addition to what is shown by |
| 826 | "merge" style, shows the original contents). |
| 827 | </p> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 828 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 829 | <dt class="hdlist1"> |
| Junio C Hamano | c28068f | 2009-09-08 00:55:23 | [diff] [blame] | 830 | -p |
| 831 | </dt> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 832 | <dt class="hdlist1"> |
| Junio C Hamano | c28068f | 2009-09-08 00:55:23 | [diff] [blame] | 833 | --patch |
| 834 | </dt> |
| 835 | <dd> |
| 836 | <p> |
| 837 | Interactively select hunks in the difference between the |
| 838 | <tree-ish> (or the index, if unspecified) and the working |
| 839 | tree. The chosen hunks are then applied in reverse to the |
| 840 | working tree (and if a <tree-ish> was specified, the index). |
| 841 | </p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 842 | <div class="paragraph"><p>This means that you can use <tt>git checkout -p</tt> to selectively discard |
| Junio C Hamano | b76a686 | 2012-05-02 22:02:46 | [diff] [blame] | 843 | edits from your current working tree. See the <tt>`Interactive Mode'' |
| 844 | section of linkgit:git-add[1] to learn how to operate the `--patch</tt> mode.</p></div> |
| Junio C Hamano | c28068f | 2009-09-08 00:55:23 | [diff] [blame] | 845 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 846 | <dt class="hdlist1"> |
| Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 847 | <branch> |
| 848 | </dt> |
| 849 | <dd> |
| 850 | <p> |
| 851 | Branch to checkout; if it refers to a branch (i.e., a name that, |
| 852 | when prepended with "refs/heads/", is a valid ref), then that |
| 853 | branch is checked out. Otherwise, if it refers to a valid |
| 854 | commit, your HEAD becomes "detached" and you are no longer on |
| 855 | any branch (see below for details). |
| 856 | </p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 857 | <div class="paragraph"><p>As a special case, the <tt>"@{-N}"</tt> syntax for the N-th last branch |
| Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 858 | checks out the branch (instead of detaching). You may also specify |
| 859 | <tt>-</tt> which is synonymous with <tt>"@{-1}"</tt>.</p></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 860 | <div class="paragraph"><p>As a further special case, you may use <tt>"A...B"</tt> as a shortcut for the |
| Junio C Hamano | e32ec8b | 2010-06-02 23:32:31 | [diff] [blame] | 861 | merge base of <tt>A</tt> and <tt>B</tt> if there is exactly one merge base. You can |
| 862 | leave out at most one of <tt>A</tt> and <tt>B</tt>, in which case it defaults to <tt>HEAD</tt>.</p></div> |
| Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 863 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 864 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 865 | <new_branch> |
| 866 | </dt> |
| 867 | <dd> |
| 868 | <p> |
| 869 | Name for the new branch. |
| 870 | </p> |
| 871 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 872 | <dt class="hdlist1"> |
| Junio C Hamano | 3bd66e9 | 2009-04-18 06:17:56 | [diff] [blame] | 873 | <start_point> |
| 874 | </dt> |
| 875 | <dd> |
| 876 | <p> |
| 877 | The name of a commit at which to start the new branch; see |
| 878 | <a href="git-branch.html">git-branch(1)</a> for details. Defaults to HEAD. |
| 879 | </p> |
| 880 | </dd> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 881 | <dt class="hdlist1"> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 882 | <tree-ish> |
| 883 | </dt> |
| 884 | <dd> |
| 885 | <p> |
| 886 | Tree to checkout from (when paths are given). If not specified, |
| 887 | the index will be used. |
| 888 | </p> |
| 889 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 890 | </dl></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 891 | </div> |
| Junio C Hamano | 63c2bc9 | 2011-02-28 06:41:28 | [diff] [blame] | 892 | <h2 id="_detached_head">DETACHED HEAD</h2> |
| Junio C Hamano | 4f9a605 | 2007-01-17 20:25:16 | [diff] [blame] | 893 | <div class="sectionbody"> |
| Junio C Hamano | 63c2bc9 | 2011-02-28 06:41:28 | [diff] [blame] | 894 | <div class="paragraph"><p>HEAD normally refers to a named branch (e.g. <em>master</em>). Meanwhile, each |
| 895 | branch refers to a specific commit. Let’s look at a repo with three |
| 896 | commits, one of them tagged, and with branch <em>master</em> checked out:</p></div> |
| Junio C Hamano | 4f9a605 | 2007-01-17 20:25:16 | [diff] [blame] | 897 | <div class="listingblock"> |
| 898 | <div class="content"> |
| Junio C Hamano | 63c2bc9 | 2011-02-28 06:41:28 | [diff] [blame] | 899 | <pre><tt> HEAD (refers to branch 'master') |
| 900 | | |
| 901 | v |
| 902 | a---b---c branch 'master' (refers to commit 'c') |
| 903 | ^ |
| 904 | | |
| 905 | tag 'v2.0' (refers to commit 'b')</tt></pre> |
| Junio C Hamano | 4f9a605 | 2007-01-17 20:25:16 | [diff] [blame] | 906 | </div></div> |
| Junio C Hamano | 63c2bc9 | 2011-02-28 06:41:28 | [diff] [blame] | 907 | <div class="paragraph"><p>When a commit is created in this state, the branch is updated to refer to |
| 908 | the new commit. Specifically, <em>git commit</em> creates a new commit <em>d</em>, whose |
| 909 | parent is commit <em>c</em>, and then updates branch <em>master</em> to refer to new |
| 910 | commit <em>d</em>. HEAD still refers to branch <em>master</em> and so indirectly now refers |
| 911 | to commit <em>d</em>:</p></div> |
| Junio C Hamano | 9d52e57 | 2007-02-13 23:48:20 | [diff] [blame] | 912 | <div class="listingblock"> |
| 913 | <div class="content"> |
| Junio C Hamano | 63c2bc9 | 2011-02-28 06:41:28 | [diff] [blame] | 914 | <pre><tt>$ edit; git add; git commit |
| 915 | |
| 916 | HEAD (refers to branch 'master') |
| 917 | | |
| 918 | v |
| 919 | a---b---c---d branch 'master' (refers to commit 'd') |
| 920 | ^ |
| 921 | | |
| 922 | tag 'v2.0' (refers to commit 'b')</tt></pre> |
| 923 | </div></div> |
| 924 | <div class="paragraph"><p>It is sometimes useful to be able to checkout a commit that is not at |
| 925 | the tip of any named branch, or even to create a new commit that is not |
| 926 | referenced by a named branch. Let’s look at what happens when we |
| 927 | checkout commit <em>b</em> (here we show two ways this may be done):</p></div> |
| 928 | <div class="listingblock"> |
| 929 | <div class="content"> |
| 930 | <pre><tt>$ git checkout v2.0 # or |
| 931 | $ git checkout master^^ |
| 932 | |
| 933 | HEAD (refers to commit 'b') |
| 934 | | |
| 935 | v |
| 936 | a---b---c---d branch 'master' (refers to commit 'd') |
| 937 | ^ |
| 938 | | |
| 939 | tag 'v2.0' (refers to commit 'b')</tt></pre> |
| 940 | </div></div> |
| 941 | <div class="paragraph"><p>Notice that regardless of which checkout command we use, HEAD now refers |
| 942 | directly to commit <em>b</em>. This is known as being in detached HEAD state. |
| 943 | It means simply that HEAD refers to a specific commit, as opposed to |
| 944 | referring to a named branch. Let’s see what happens when we create a commit:</p></div> |
| 945 | <div class="listingblock"> |
| 946 | <div class="content"> |
| 947 | <pre><tt>$ edit; git add; git commit |
| 948 | |
| 949 | HEAD (refers to commit 'e') |
| 950 | | |
| 951 | v |
| 952 | e |
| 953 | / |
| 954 | a---b---c---d branch 'master' (refers to commit 'd') |
| 955 | ^ |
| 956 | | |
| 957 | tag 'v2.0' (refers to commit 'b')</tt></pre> |
| 958 | </div></div> |
| 959 | <div class="paragraph"><p>There is now a new commit <em>e</em>, but it is referenced only by HEAD. We can |
| 960 | of course add yet another commit in this state:</p></div> |
| 961 | <div class="listingblock"> |
| 962 | <div class="content"> |
| 963 | <pre><tt>$ edit; git add; git commit |
| 964 | |
| 965 | HEAD (refers to commit 'f') |
| 966 | | |
| 967 | v |
| 968 | e---f |
| 969 | / |
| 970 | a---b---c---d branch 'master' (refers to commit 'd') |
| 971 | ^ |
| 972 | | |
| 973 | tag 'v2.0' (refers to commit 'b')</tt></pre> |
| 974 | </div></div> |
| 975 | <div class="paragraph"><p>In fact, we can perform all the normal git operations. But, let’s look |
| 976 | at what happens when we then checkout master:</p></div> |
| 977 | <div class="listingblock"> |
| 978 | <div class="content"> |
| 979 | <pre><tt>$ git checkout master |
| 980 | |
| 981 | HEAD (refers to branch 'master') |
| 982 | e---f | |
| 983 | / v |
| 984 | a---b---c---d branch 'master' (refers to commit 'd') |
| 985 | ^ |
| 986 | | |
| 987 | tag 'v2.0' (refers to commit 'b')</tt></pre> |
| 988 | </div></div> |
| 989 | <div class="paragraph"><p>It is important to realize that at this point nothing refers to commit |
| 990 | <em>f</em>. Eventually commit <em>f</em> (and by extension commit <em>e</em>) will be deleted |
| 991 | by the routine git garbage collection process, unless we create a reference |
| 992 | before that happens. If we have not yet moved away from commit <em>f</em>, |
| 993 | any of these will create a reference to it:</p></div> |
| 994 | <div class="listingblock"> |
| 995 | <div class="content"> |
| 996 | <pre><tt>$ git checkout -b foo <b><1></b> |
| 997 | $ git branch foo <b><2></b> |
| 998 | $ git tag foo <b><3></b></tt></pre> |
| 999 | </div></div> |
| 1000 | <div class="colist arabic"><ol> |
| 1001 | <li> |
| 1002 | <p> |
| 1003 | creates a new branch <em>foo</em>, which refers to commit <em>f</em>, and then |
| 1004 | updates HEAD to refer to branch <em>foo</em>. In other words, we’ll no longer |
| 1005 | be in detached HEAD state after this command. |
| 1006 | </p> |
| 1007 | </li> |
| 1008 | <li> |
| 1009 | <p> |
| 1010 | similarly creates a new branch <em>foo</em>, which refers to commit <em>f</em>, |
| 1011 | but leaves HEAD detached. |
| 1012 | </p> |
| 1013 | </li> |
| 1014 | <li> |
| 1015 | <p> |
| 1016 | creates a new tag <em>foo</em>, which refers to commit <em>f</em>, |
| 1017 | leaving HEAD detached. |
| 1018 | </p> |
| 1019 | </li> |
| 1020 | </ol></div> |
| 1021 | <div class="paragraph"><p>If we have moved away from commit <em>f</em>, then we must first recover its object |
| 1022 | name (typically by using git reflog), and then we can create a reference to |
| 1023 | it. For example, to see the last two commits to which HEAD referred, we |
| 1024 | can use either of these commands:</p></div> |
| 1025 | <div class="listingblock"> |
| 1026 | <div class="content"> |
| 1027 | <pre><tt>$ git reflog -2 HEAD # or |
| 1028 | $ git log -g -2 HEAD</tt></pre> |
| Junio C Hamano | 9d52e57 | 2007-02-13 23:48:20 | [diff] [blame] | 1029 | </div></div> |
| Junio C Hamano | 4f9a605 | 2007-01-17 20:25:16 | [diff] [blame] | 1030 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1031 | <h2 id="_examples">EXAMPLES</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1032 | <div class="sectionbody"> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1033 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1034 | <li> |
| 1035 | <p> |
| 1036 | The following sequence checks out the <tt>master</tt> branch, reverts |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1037 | the <tt>Makefile</tt> to two revisions back, deletes hello.c by |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1038 | mistake, and gets it back from the index. |
| 1039 | </p> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1040 | <div class="listingblock"> |
| 1041 | <div class="content"> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1042 | <pre><tt>$ git checkout master <b><1></b> |
| 1043 | $ git checkout master~2 Makefile <b><2></b> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1044 | $ rm -f hello.c |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1045 | $ git checkout hello.c <b><3></b></tt></pre> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1046 | </div></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1047 | <div class="colist arabic"><ol> |
| Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 1048 | <li> |
| 1049 | <p> |
| 1050 | switch branch |
| 1051 | </p> |
| 1052 | </li> |
| 1053 | <li> |
| 1054 | <p> |
| Junio C Hamano | 5705393 | 2009-03-11 08:48:32 | [diff] [blame] | 1055 | take a file out of another commit |
| Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 1056 | </p> |
| 1057 | </li> |
| 1058 | <li> |
| 1059 | <p> |
| Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1060 | restore hello.c from the index |
| Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 1061 | </p> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1062 | <div class="paragraph"><p>If you have an unfortunate branch that is named <tt>hello.c</tt>, this |
| Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 1063 | step would be confused as an instruction to switch to that branch. |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1064 | You should instead write:</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1065 | <div class="listingblock"> |
| 1066 | <div class="content"> |
| 1067 | <pre><tt>$ git checkout -- hello.c</tt></pre> |
| 1068 | </div></div> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1069 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1070 | </ol></div> |
| Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 1071 | </li> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1072 | <li> |
| 1073 | <p> |
| Junio C Hamano | 5705393 | 2009-03-11 08:48:32 | [diff] [blame] | 1074 | After working in the wrong branch, switching to the correct |
| Junio C Hamano | 2b13527 | 2006-03-18 07:45:42 | [diff] [blame] | 1075 | branch would be done using: |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1076 | </p> |
| 1077 | <div class="listingblock"> |
| 1078 | <div class="content"> |
| 1079 | <pre><tt>$ git checkout mytopic</tt></pre> |
| 1080 | </div></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1081 | <div class="paragraph"><p>However, your "wrong" branch and correct "mytopic" branch may |
| Junio C Hamano | 5705393 | 2009-03-11 08:48:32 | [diff] [blame] | 1082 | differ in files that you have modified locally, in which case |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1083 | the above checkout would fail like this:</p></div> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1084 | <div class="listingblock"> |
| 1085 | <div class="content"> |
| 1086 | <pre><tt>$ git checkout mytopic |
| Junio C Hamano | f2d3a37 | 2010-07-12 14:14:18 | [diff] [blame] | 1087 | error: You have local changes to 'frotz'; not switching branches.</tt></pre> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1088 | </div></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1089 | <div class="paragraph"><p>You can give the <tt>-m</tt> flag to the command, which would try a |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1090 | three-way merge:</p></div> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1091 | <div class="listingblock"> |
| 1092 | <div class="content"> |
| 1093 | <pre><tt>$ git checkout -m mytopic |
| 1094 | Auto-merging frotz</tt></pre> |
| 1095 | </div></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1096 | <div class="paragraph"><p>After this three-way merge, the local modifications are <em>not</em> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1097 | registered in your index file, so <tt>git diff</tt> would show you what |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1098 | changes you made since the tip of the new branch.</p></div> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1099 | </li> |
| 1100 | <li> |
| 1101 | <p> |
| 1102 | When a merge conflict happens during switching branches with |
| 1103 | the <tt>-m</tt> option, you would see something like this: |
| 1104 | </p> |
| 1105 | <div class="listingblock"> |
| 1106 | <div class="content"> |
| 1107 | <pre><tt>$ git checkout -m mytopic |
| 1108 | Auto-merging frotz |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1109 | ERROR: Merge conflict in frotz |
| 1110 | fatal: merge program failed</tt></pre> |
| 1111 | </div></div> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1112 | <div class="paragraph"><p>At this point, <tt>git diff</tt> shows the changes cleanly merged as in |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1113 | the previous example, as well as the changes in the conflicted |
| 1114 | files. Edit and resolve the conflict and mark it resolved with |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1115 | <tt>git add</tt> as usual:</p></div> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1116 | <div class="listingblock"> |
| 1117 | <div class="content"> |
| 1118 | <pre><tt>$ edit frotz |
| Junio C Hamano | 89d4e0f | 2007-02-18 00:34:59 | [diff] [blame] | 1119 | $ git add frotz</tt></pre> |
| Junio C Hamano | 74e8a2d | 2006-01-14 03:58:41 | [diff] [blame] | 1120 | </div></div> |
| 1121 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1122 | </ol></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1123 | </div> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1124 | <h2 id="_git">GIT</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1125 | <div class="sectionbody"> |
| Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1126 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1127 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1128 | </div> |
| 1129 | <div id="footnotes"><hr /></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1130 | <div id="footer"> |
| 1131 | <div id="footer-text"> |
| Junio C Hamano | b76a686 | 2012-05-02 22:02:46 | [diff] [blame] | 1132 | Last updated 2012-05-02 15:00:44 PDT |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1133 | </div> |
| 1134 | </div> |
| 1135 | </body> |
| 1136 | </html> |