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 | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 7.0.2" /> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | <style type="text/css"> |
| 8 | /* Debug borders */ |
| 9 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 10 | /* |
| 11 | border: 1px solid red; |
| 12 | */ |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | margin: 1em 5% 1em 5%; |
| 17 | } |
| 18 | |
| 19 | a { color: blue; } |
| 20 | a:visited { color: fuchsia; } |
| 21 | |
| 22 | em { |
| 23 | font-style: italic; |
| 24 | } |
| 25 | |
| 26 | strong { |
| 27 | font-weight: bold; |
| 28 | } |
| 29 | |
| 30 | tt { |
| 31 | color: navy; |
| 32 | } |
| 33 | |
| 34 | h1, h2, h3, h4, h5, h6 { |
| 35 | color: #527bbd; |
| 36 | font-family: sans-serif; |
| 37 | margin-top: 1.2em; |
| 38 | margin-bottom: 0.5em; |
| 39 | line-height: 1.3; |
| 40 | } |
| 41 | |
| 42 | h1 { |
| 43 | border-bottom: 2px solid silver; |
| 44 | } |
| 45 | h2 { |
| 46 | border-bottom: 2px solid silver; |
| 47 | padding-top: 0.5em; |
| 48 | } |
| 49 | |
| 50 | div.sectionbody { |
| 51 | font-family: serif; |
| 52 | margin-left: 0; |
| 53 | } |
| 54 | |
| 55 | hr { |
| 56 | border: 1px solid silver; |
| 57 | } |
| 58 | |
| 59 | p { |
| 60 | margin-top: 0.5em; |
| 61 | margin-bottom: 0.5em; |
| 62 | } |
| 63 | |
| 64 | pre { |
| 65 | padding: 0; |
| 66 | margin: 0; |
| 67 | } |
| 68 | |
| 69 | span#author { |
| 70 | color: #527bbd; |
| 71 | font-family: sans-serif; |
| 72 | font-weight: bold; |
| 73 | font-size: 1.2em; |
| 74 | } |
| 75 | span#email { |
| 76 | } |
| 77 | span#revision { |
| 78 | font-family: sans-serif; |
| 79 | } |
| 80 | |
| 81 | div#footer { |
| 82 | font-family: sans-serif; |
| 83 | font-size: small; |
| 84 | border-top: 2px solid silver; |
| 85 | padding-top: 0.5em; |
| 86 | margin-top: 4.0em; |
| 87 | } |
| 88 | div#footer-text { |
| 89 | float: left; |
| 90 | padding-bottom: 0.5em; |
| 91 | } |
| 92 | div#footer-badges { |
| 93 | float: right; |
| 94 | padding-bottom: 0.5em; |
| 95 | } |
| 96 | |
| 97 | div#preamble, |
| 98 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 99 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 100 | div.admonitionblock { |
| 101 | margin-right: 10%; |
| 102 | margin-top: 1.5em; |
| 103 | margin-bottom: 1.5em; |
| 104 | } |
| 105 | div.admonitionblock { |
| 106 | margin-top: 2.5em; |
| 107 | margin-bottom: 2.5em; |
| 108 | } |
| 109 | |
| 110 | div.content { /* Block element content. */ |
| 111 | padding: 0; |
| 112 | } |
| 113 | |
| 114 | /* Block element titles. */ |
| 115 | div.title, caption.title { |
| 116 | font-family: sans-serif; |
| 117 | font-weight: bold; |
| 118 | text-align: left; |
| 119 | margin-top: 1.0em; |
| 120 | margin-bottom: 0.5em; |
| 121 | } |
| 122 | div.title + * { |
| 123 | margin-top: 0; |
| 124 | } |
| 125 | |
| 126 | td div.title:first-child { |
| 127 | margin-top: 0.0em; |
| 128 | } |
| 129 | div.content div.title:first-child { |
| 130 | margin-top: 0.0em; |
| 131 | } |
| 132 | div.content + div.title { |
| 133 | margin-top: 0.0em; |
| 134 | } |
| 135 | |
| 136 | div.sidebarblock > div.content { |
| 137 | background: #ffffee; |
| 138 | border: 1px solid silver; |
| 139 | padding: 0.5em; |
| 140 | } |
| 141 | |
| 142 | div.listingblock > div.content { |
| 143 | border: 1px solid silver; |
| 144 | background: #f4f4f4; |
| 145 | padding: 0.5em; |
| 146 | } |
| 147 | |
| 148 | div.quoteblock > div.content { |
| 149 | padding-left: 2.0em; |
| 150 | } |
| 151 | div.quoteblock .attribution { |
| 152 | text-align: right; |
| 153 | } |
| 154 | |
| 155 | div.admonitionblock .icon { |
| 156 | vertical-align: top; |
| 157 | font-size: 1.1em; |
| 158 | font-weight: bold; |
| 159 | text-decoration: underline; |
| 160 | color: #527bbd; |
| 161 | padding-right: 0.5em; |
| 162 | } |
| 163 | div.admonitionblock td.content { |
| 164 | padding-left: 0.5em; |
| 165 | border-left: 2px solid silver; |
| 166 | } |
| 167 | |
| 168 | div.exampleblock > div.content { |
| 169 | border-left: 2px solid silver; |
| 170 | padding: 0.5em; |
| 171 | } |
| 172 | |
| 173 | div.verseblock div.content { |
| 174 | white-space: pre; |
| 175 | } |
| 176 | |
| 177 | div.imageblock div.content { padding-left: 0; } |
| 178 | div.imageblock img { border: 1px solid silver; } |
| 179 | span.image img { border-style: none; } |
| 180 | |
| 181 | dl { |
| 182 | margin-top: 0.8em; |
| 183 | margin-bottom: 0.8em; |
| 184 | } |
| 185 | dt { |
| 186 | margin-top: 0.5em; |
| 187 | margin-bottom: 0; |
| 188 | font-style: italic; |
| 189 | } |
| 190 | dd > *:first-child { |
| 191 | margin-top: 0; |
| 192 | } |
| 193 | |
| 194 | ul, ol { |
| 195 | list-style-position: outside; |
| 196 | } |
| 197 | ol.olist2 { |
| 198 | list-style-type: lower-alpha; |
| 199 | } |
| 200 | |
| 201 | div.tableblock > table { |
| 202 | border-color: #527bbd; |
| 203 | border-width: 3px; |
| 204 | } |
| 205 | thead { |
| 206 | font-family: sans-serif; |
| 207 | font-weight: bold; |
| 208 | } |
| 209 | tfoot { |
| 210 | font-weight: bold; |
| 211 | } |
| 212 | |
| 213 | div.hlist { |
| 214 | margin-top: 0.8em; |
| 215 | margin-bottom: 0.8em; |
| 216 | } |
| 217 | td.hlist1 { |
| 218 | vertical-align: top; |
| 219 | font-style: italic; |
| 220 | padding-right: 0.8em; |
| 221 | } |
| 222 | td.hlist2 { |
| 223 | vertical-align: top; |
| 224 | } |
| 225 | |
| 226 | @media print { |
| 227 | div#footer-badges { display: none; } |
| 228 | } |
| 229 | include::./stylesheets/xhtml11-manpage.css[] |
| 230 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 231 | |
| 232 | div.sidebar-content { |
| 233 | background: #ffffee; |
| 234 | border: 1px solid silver; |
| 235 | padding: 0.5em; |
| 236 | } |
| 237 | div.sidebar-title, div.image-title { |
| 238 | font-family: sans-serif; |
| 239 | font-weight: bold; |
| 240 | margin-top: 0.0em; |
| 241 | margin-bottom: 0.5em; |
| 242 | } |
| 243 | |
| 244 | div.listingblock div.content { |
| 245 | border: 1px solid silver; |
| 246 | background: #f4f4f4; |
| 247 | padding: 0.5em; |
| 248 | } |
| 249 | |
| 250 | div.quoteblock-content { |
| 251 | padding-left: 2.0em; |
| 252 | } |
| 253 | |
| 254 | div.exampleblock-content { |
| 255 | border-left: 2px solid silver; |
| 256 | padding-left: 0.5em; |
| 257 | } |
| 258 | </style> |
| 259 | <title>git-diff(1)</title> |
| 260 | </head> |
| 261 | <body> |
| 262 | <div id="header"> |
| 263 | <h1> |
| 264 | git-diff(1) Manual Page |
| 265 | </h1> |
| 266 | <h2>NAME</h2> |
| 267 | <div class="sectionbody"> |
| 268 | <p>git-diff - |
Junio C Hamano | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 269 | Show changes between commits, commit and working tree, etc |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 270 | </p> |
| 271 | </div> |
| 272 | </div> |
| 273 | <h2>SYNOPSIS</h2> |
| 274 | <div class="sectionbody"> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 275 | <p><em>git-diff</em> [ --diff-options ] <tree-ish>{0,2} [--] [<path>…]</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 276 | </div> |
| 277 | <h2>DESCRIPTION</h2> |
| 278 | <div class="sectionbody"> |
Junio C Hamano | 51c2ab0 | 2006-07-09 20:38:54 | [diff] [blame] | 279 | <p>Show changes between two trees, a tree and the working tree, a |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 280 | tree and the index file, or the index file and the working tree.</p> |
| 281 | <dl> |
| 282 | <dt> |
| 283 | <em>git-diff</em> [--options] [--] [<path>…] |
| 284 | </dt> |
| 285 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 286 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 287 | This form is to view the changes you made relative to |
| 288 | the index (staging area for the next commit). In other |
| 289 | words, the differences are what you _could_ tell git to |
| 290 | further add to the index but you still haven't. You can |
| 291 | stage these changes by using <a href="git-add.html">git-add(1)</a>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 292 | </p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 293 | </dd> |
| 294 | <dt> |
| 295 | <em>git-diff</em> [--options] --cached [<commit>] [--] [<path>…] |
| 296 | </dt> |
| 297 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 298 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 299 | This form is to view the changes you staged for the next |
| 300 | commit relative to the named <tree-ish>. Typically you |
| 301 | would want comparison with the latest commit, so if you |
| 302 | do not give <commit>, it defaults to HEAD. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 303 | </p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 304 | </dd> |
| 305 | <dt> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 306 | <em>git-diff</em> [--options] <commit> [--] [<path>…] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 307 | </dt> |
| 308 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 309 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 310 | This form is to view the changes you have in your |
| 311 | working tree relative to the named <commit>. You can |
| 312 | use HEAD to compare it with the latest commit, or a |
| 313 | branch name to compare with the tip of a different |
| 314 | branch. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 315 | </p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 316 | </dd> |
| 317 | <dt> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 318 | <em>git-diff</em> [--options] <commit> <commit> [--] [<path>…] |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 319 | </dt> |
| 320 | <dd> |
| 321 | <p> |
| 322 | This form is to view the changes between two <commit>, |
| 323 | for example, tips of two branches. |
| 324 | </p> |
| 325 | </dd> |
| 326 | </dl> |
| 327 | <p>Just in case if you are doing something exotic, it should be |
| 328 | noted that all of the <commit> in the above description can be |
| 329 | any <tree-ish>.</p> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 330 | </div> |
| 331 | <h2>OPTIONS</h2> |
| 332 | <div class="sectionbody"> |
| 333 | <dl> |
| 334 | <dt> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 335 | -p |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 336 | </dt> |
| 337 | <dd> |
| 338 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 339 | Generate patch (see section on generating patches) |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 340 | </p> |
| 341 | </dd> |
| 342 | <dt> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 343 | -u |
| 344 | </dt> |
| 345 | <dd> |
| 346 | <p> |
| 347 | Synonym for "-p". |
| 348 | </p> |
| 349 | </dd> |
| 350 | <dt> |
| 351 | --raw |
| 352 | </dt> |
| 353 | <dd> |
| 354 | <p> |
| 355 | Generate the raw format. |
| 356 | </p> |
| 357 | </dd> |
| 358 | <dt> |
| 359 | --patch-with-raw |
| 360 | </dt> |
| 361 | <dd> |
| 362 | <p> |
| 363 | Synonym for "-p --raw". |
| 364 | </p> |
| 365 | </dd> |
| 366 | <dt> |
| 367 | --stat[=width[,name-width]] |
| 368 | </dt> |
| 369 | <dd> |
| 370 | <p> |
| 371 | Generate a diffstat. You can override the default |
| 372 | output width for 80-column terminal by "--stat=width". |
| 373 | The width of the filename part can be controlled by |
| 374 | giving another width to it separated by a comma. |
| 375 | </p> |
| 376 | </dd> |
| 377 | <dt> |
| 378 | --numstat |
| 379 | </dt> |
| 380 | <dd> |
| 381 | <p> |
| 382 | Similar to --stat, but shows number of added and |
| 383 | deleted lines in decimal notation and pathname without |
| 384 | abbreviation, to make it more machine friendly. |
| 385 | </p> |
| 386 | </dd> |
| 387 | <dt> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 388 | --shortstat |
| 389 | </dt> |
| 390 | <dd> |
| 391 | <p> |
| 392 | Output only the last line of the --stat format containing total |
| 393 | number of modified files, as well as number of added and deleted |
| 394 | lines. |
| 395 | </p> |
| 396 | </dd> |
| 397 | <dt> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 398 | --summary |
| 399 | </dt> |
| 400 | <dd> |
| 401 | <p> |
| 402 | Output a condensed summary of extended header information |
| 403 | such as creations, renames and mode changes. |
| 404 | </p> |
| 405 | </dd> |
| 406 | <dt> |
| 407 | --patch-with-stat |
| 408 | </dt> |
| 409 | <dd> |
| 410 | <p> |
| 411 | Synonym for "-p --stat". |
| 412 | </p> |
| 413 | </dd> |
| 414 | <dt> |
| 415 | -z |
| 416 | </dt> |
| 417 | <dd> |
| 418 | <p> |
| 419 | \0 line termination on output |
| 420 | </p> |
| 421 | </dd> |
| 422 | <dt> |
| 423 | --name-only |
| 424 | </dt> |
| 425 | <dd> |
| 426 | <p> |
| 427 | Show only names of changed files. |
| 428 | </p> |
| 429 | </dd> |
| 430 | <dt> |
| 431 | --name-status |
| 432 | </dt> |
| 433 | <dd> |
| 434 | <p> |
| 435 | Show only names and status of changed files. |
| 436 | </p> |
| 437 | </dd> |
| 438 | <dt> |
| 439 | --color |
| 440 | </dt> |
| 441 | <dd> |
| 442 | <p> |
| 443 | Show colored diff. |
| 444 | </p> |
| 445 | </dd> |
| 446 | <dt> |
| 447 | --no-color |
| 448 | </dt> |
| 449 | <dd> |
| 450 | <p> |
| 451 | Turn off colored diff, even when the configuration file |
| 452 | gives the default to color output. |
| 453 | </p> |
| 454 | </dd> |
| 455 | <dt> |
| 456 | --color-words |
| 457 | </dt> |
| 458 | <dd> |
| 459 | <p> |
| 460 | Show colored word diff, i.e. color words which have changed. |
| 461 | </p> |
| 462 | </dd> |
| 463 | <dt> |
| 464 | --no-renames |
| 465 | </dt> |
| 466 | <dd> |
| 467 | <p> |
| 468 | Turn off rename detection, even when the configuration |
| 469 | file gives the default to do so. |
| 470 | </p> |
| 471 | </dd> |
| 472 | <dt> |
| 473 | --full-index |
| 474 | </dt> |
| 475 | <dd> |
| 476 | <p> |
| 477 | Instead of the first handful characters, show full |
| 478 | object name of pre- and post-image blob on the "index" |
| 479 | line when generating a patch format output. |
| 480 | </p> |
| 481 | </dd> |
| 482 | <dt> |
| 483 | --binary |
| 484 | </dt> |
| 485 | <dd> |
| 486 | <p> |
| 487 | In addition to --full-index, output "binary diff" that |
| 488 | can be applied with "git apply". |
| 489 | </p> |
| 490 | </dd> |
| 491 | <dt> |
| 492 | --abbrev[=<n>] |
| 493 | </dt> |
| 494 | <dd> |
| 495 | <p> |
| 496 | Instead of showing the full 40-byte hexadecimal object |
| 497 | name in diff-raw format output and diff-tree header |
| 498 | lines, show only handful hexdigits prefix. This is |
| 499 | independent of --full-index option above, which controls |
| 500 | the diff-patch output format. Non default number of |
| 501 | digits can be specified with --abbrev=<n>. |
| 502 | </p> |
| 503 | </dd> |
| 504 | <dt> |
| 505 | -B |
| 506 | </dt> |
| 507 | <dd> |
| 508 | <p> |
| 509 | Break complete rewrite changes into pairs of delete and create. |
| 510 | </p> |
| 511 | </dd> |
| 512 | <dt> |
| 513 | -M |
| 514 | </dt> |
| 515 | <dd> |
| 516 | <p> |
| 517 | Detect renames. |
| 518 | </p> |
| 519 | </dd> |
| 520 | <dt> |
| 521 | -C |
| 522 | </dt> |
| 523 | <dd> |
| 524 | <p> |
| 525 | Detect copies as well as renames. |
| 526 | </p> |
| 527 | </dd> |
| 528 | <dt> |
| 529 | --diff-filter=[ACDMRTUXB*] |
| 530 | </dt> |
| 531 | <dd> |
| 532 | <p> |
| 533 | Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>), |
| 534 | Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their |
| 535 | type (mode) changed (<tt>T</tt>), are Unmerged (<tt>U</tt>), are |
| 536 | Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>). |
| 537 | Any combination of the filter characters may be used. |
| 538 | When <tt>*</tt> (All-or-none) is added to the combination, all |
| 539 | paths are selected if there is any file that matches |
| 540 | other criteria in the comparison; if there is no file |
| 541 | that matches other criteria, nothing is selected. |
| 542 | </p> |
| 543 | </dd> |
| 544 | <dt> |
| 545 | --find-copies-harder |
| 546 | </dt> |
| 547 | <dd> |
| 548 | <p> |
| 549 | For performance reasons, by default, -C option finds copies only |
| 550 | if the original file of the copy was modified in the same |
| 551 | changeset. This flag makes the command |
| 552 | inspect unmodified files as candidates for the source of |
| 553 | copy. This is a very expensive operation for large |
| 554 | projects, so use it with caution. |
| 555 | </p> |
| 556 | </dd> |
| 557 | <dt> |
| 558 | -l<num> |
| 559 | </dt> |
| 560 | <dd> |
| 561 | <p> |
| 562 | -M and -C options require O(n^2) processing time where n |
| 563 | is the number of potential rename/copy targets. This |
| 564 | option prevents rename/copy detection from running if |
| 565 | the number of rename/copy targets exceeds the specified |
| 566 | number. |
| 567 | </p> |
| 568 | </dd> |
| 569 | <dt> |
| 570 | -S<string> |
| 571 | </dt> |
| 572 | <dd> |
| 573 | <p> |
| 574 | Look for differences that contain the change in <string>. |
| 575 | </p> |
| 576 | </dd> |
| 577 | <dt> |
| 578 | --pickaxe-all |
| 579 | </dt> |
| 580 | <dd> |
| 581 | <p> |
| 582 | When -S finds a change, show all the changes in that |
| 583 | changeset, not just the files that contain the change |
| 584 | in <string>. |
| 585 | </p> |
| 586 | </dd> |
| 587 | <dt> |
| 588 | --pickaxe-regex |
| 589 | </dt> |
| 590 | <dd> |
| 591 | <p> |
| 592 | Make the <string> not a plain string but an extended POSIX |
| 593 | regex to match. |
| 594 | </p> |
| 595 | </dd> |
| 596 | <dt> |
| 597 | -O<orderfile> |
| 598 | </dt> |
| 599 | <dd> |
| 600 | <p> |
| 601 | Output the patch in the order specified in the |
| 602 | <orderfile>, which has one shell glob pattern per line. |
| 603 | </p> |
| 604 | </dd> |
| 605 | <dt> |
| 606 | -R |
| 607 | </dt> |
| 608 | <dd> |
| 609 | <p> |
| 610 | Swap two inputs; that is, show differences from index or |
| 611 | on-disk file to tree contents. |
| 612 | </p> |
| 613 | </dd> |
| 614 | <dt> |
| 615 | --text |
| 616 | </dt> |
| 617 | <dd> |
| 618 | <p> |
| 619 | Treat all files as text. |
| 620 | </p> |
| 621 | </dd> |
| 622 | <dt> |
| 623 | -a |
| 624 | </dt> |
| 625 | <dd> |
| 626 | <p> |
| 627 | Shorthand for "--text". |
| 628 | </p> |
| 629 | </dd> |
| 630 | <dt> |
| 631 | --ignore-space-change |
| 632 | </dt> |
| 633 | <dd> |
| 634 | <p> |
| 635 | Ignore changes in amount of white space. This ignores white |
| 636 | space at line end, and consider all other sequences of one or |
| 637 | more white space characters to be equivalent. |
| 638 | </p> |
| 639 | </dd> |
| 640 | <dt> |
| 641 | -b |
| 642 | </dt> |
| 643 | <dd> |
| 644 | <p> |
| 645 | Shorthand for "--ignore-space-change". |
| 646 | </p> |
| 647 | </dd> |
| 648 | <dt> |
| 649 | --ignore-all-space |
| 650 | </dt> |
| 651 | <dd> |
| 652 | <p> |
| 653 | Ignore white space when comparing lines. This ignores |
| 654 | difference even if one line has white space where the other |
| 655 | line has none. |
| 656 | </p> |
| 657 | </dd> |
| 658 | <dt> |
| 659 | -w |
| 660 | </dt> |
| 661 | <dd> |
| 662 | <p> |
| 663 | Shorthand for "--ignore-all-space". |
| 664 | </p> |
| 665 | </dd> |
| 666 | </dl> |
| 667 | <p>For more detailed explanation on these common options, see also |
| 668 | <a href="diffcore.html">diffcore documentation</a>.</p> |
| 669 | <dl> |
| 670 | <dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 671 | <path>… |
| 672 | </dt> |
| 673 | <dd> |
| 674 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 675 | The <paths> parameters, when given, are used to limit |
| 676 | the diff to the named paths (you can give directory |
| 677 | names and get diff for all files under them). |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 678 | </p> |
| 679 | </dd> |
| 680 | </dl> |
| 681 | </div> |
| 682 | <h2>EXAMPLES</h2> |
| 683 | <div class="sectionbody"> |
| 684 | <dl> |
| 685 | <dt> |
| 686 | Various ways to check your working tree |
| 687 | </dt> |
| 688 | <dd> |
| 689 | <div class="listingblock"> |
| 690 | <div class="content"> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 691 | <pre><tt>$ git diff <b>(1)</b> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 692 | $ git diff --cached <b>(2)</b> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 693 | $ git diff HEAD <b>(3)</b></tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 694 | </div></div> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 695 | <ol> |
| 696 | <li> |
| 697 | <p> |
Junio C Hamano | 47848ae | 2006-12-14 11:20:06 | [diff] [blame] | 698 | changes in the working tree not yet staged for the next commit. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 699 | </p> |
| 700 | </li> |
| 701 | <li> |
| 702 | <p> |
| 703 | changes between the index and your last commit; what you |
| 704 | would be committing if you run "git commit" without "-a" option. |
| 705 | </p> |
| 706 | </li> |
| 707 | <li> |
| 708 | <p> |
| 709 | changes in the working tree since your last commit; what you |
| 710 | would be committing if you run "git commit -a" |
| 711 | </p> |
| 712 | </li> |
| 713 | </ol> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 714 | </dd> |
| 715 | <dt> |
| 716 | Comparing with arbitrary commits |
| 717 | </dt> |
| 718 | <dd> |
| 719 | <div class="listingblock"> |
| 720 | <div class="content"> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 721 | <pre><tt>$ git diff test <b>(1)</b> |
| 722 | $ git diff HEAD -- ./test <b>(2)</b> |
| 723 | $ git diff HEAD^ HEAD <b>(3)</b></tt></pre> |
| 724 | </div></div> |
| 725 | <ol> |
| 726 | <li> |
| 727 | <p> |
| 728 | instead of using the tip of the current branch, compare with the |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 729 | tip of "test" branch. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 730 | </p> |
| 731 | </li> |
| 732 | <li> |
| 733 | <p> |
| 734 | instead of comparing with the tip of "test" branch, compare with |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 735 | the tip of the current branch, but limit the comparison to the |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 736 | file "test". |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 737 | </p> |
| 738 | </li> |
| 739 | <li> |
| 740 | <p> |
| 741 | compare the version before the last commit and the last commit. |
| 742 | </p> |
| 743 | </li> |
| 744 | </ol> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 745 | </dd> |
| 746 | <dt> |
| 747 | Limiting the diff output |
| 748 | </dt> |
| 749 | <dd> |
| 750 | <div class="listingblock"> |
| 751 | <div class="content"> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 752 | <pre><tt>$ git diff --diff-filter=MRC <b>(1)</b> |
| 753 | $ git diff --name-status -r <b>(2)</b> |
| 754 | $ git diff arch/i386 include/asm-i386 <b>(3)</b></tt></pre> |
| 755 | </div></div> |
| 756 | <ol> |
| 757 | <li> |
| 758 | <p> |
| 759 | show only modification, rename and copy, but not addition |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 760 | nor deletion. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 761 | </p> |
| 762 | </li> |
| 763 | <li> |
| 764 | <p> |
| 765 | show only names and the nature of change, but not actual |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 766 | diff output. --name-status disables usual patch generation |
Junio C Hamano | 341071d | 2006-06-04 07:24:48 | [diff] [blame] | 767 | which in turn also disables recursive behavior, so without -r |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 768 | you would only see the directory name if there is a change in a |
| 769 | file in a subdirectory. |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 770 | </p> |
| 771 | </li> |
| 772 | <li> |
| 773 | <p> |
| 774 | limit diff output to named subtrees. |
| 775 | </p> |
| 776 | </li> |
| 777 | </ol> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 778 | </dd> |
| 779 | <dt> |
| 780 | Munging the diff output |
| 781 | </dt> |
| 782 | <dd> |
| 783 | <div class="listingblock"> |
| 784 | <div class="content"> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 785 | <pre><tt>$ git diff --find-copies-harder -B -C <b>(1)</b> |
| 786 | $ git diff -R <b>(2)</b></tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 787 | </div></div> |
Junio C Hamano | c8d88c2 | 2006-04-29 07:02:01 | [diff] [blame] | 788 | <ol> |
| 789 | <li> |
| 790 | <p> |
| 791 | spend extra cycles to find renames, copies and complete |
| 792 | rewrites (very expensive). |
| 793 | </p> |
| 794 | </li> |
| 795 | <li> |
| 796 | <p> |
| 797 | output diff in reverse. |
| 798 | </p> |
| 799 | </li> |
| 800 | </ol> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 801 | </dd> |
| 802 | </dl> |
| 803 | </div> |
| 804 | <h2>Author</h2> |
| 805 | <div class="sectionbody"> |
| 806 | <p>Written by Linus Torvalds <torvalds@osdl.org></p> |
| 807 | </div> |
| 808 | <h2>Documentation</h2> |
| 809 | <div class="sectionbody"> |
| 810 | <p>Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.</p> |
| 811 | </div> |
| 812 | <h2>GIT</h2> |
| 813 | <div class="sectionbody"> |
| 814 | <p>Part of the <a href="git.html">git(7)</a> suite</p> |
| 815 | </div> |
| 816 | <div id="footer"> |
| 817 | <div id="footer-text"> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 818 | Last updated 16-Dec-2006 07:43:51 UTC |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 819 | </div> |
| 820 | </div> |
| 821 | </body> |
| 822 | </html> |