diff-options.txt 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  1. // Please don't remove this comment as asciidoc behaves badly when
  2. // the first non-empty line is ifdef/ifndef. The symptom is that
  3. // without this comment the <git-diff-core> attribute conditionally
  4. // defined below ends up being defined unconditionally.
  5. // Last checked with asciidoc 7.0.2.
  6. ifndef::git-format-patch[]
  7. ifndef::git-diff[]
  8. ifndef::git-log[]
  9. :git-diff-core: 1
  10. endif::git-log[]
  11. endif::git-diff[]
  12. endif::git-format-patch[]
  13. ifdef::git-format-patch[]
  14. -p::
  15. --no-stat::
  16. Generate plain patches without any diffstats.
  17. endif::git-format-patch[]
  18. ifndef::git-format-patch[]
  19. -p::
  20. -u::
  21. --patch::
  22. Generate patch (see section on generating patches).
  23. ifdef::git-diff[]
  24. This is the default.
  25. endif::git-diff[]
  26. -s::
  27. --no-patch::
  28. Suppress diff output. Useful for commands like `git show` that
  29. show the patch by default, or to cancel the effect of `--patch`.
  30. endif::git-format-patch[]
  31. -U<n>::
  32. --unified=<n>::
  33. Generate diffs with <n> lines of context instead of
  34. the usual three. Implies `--patch`.
  35. ifndef::git-format-patch[]
  36. Implies `-p`.
  37. endif::git-format-patch[]
  38. --output=<file>::
  39. Output to a specific file instead of stdout.
  40. --output-indicator-new=<char>::
  41. --output-indicator-old=<char>::
  42. --output-indicator-context=<char>::
  43. Specify the character used to indicate new, old or context
  44. lines in the generated patch. Normally they are '+', '-' and
  45. ' ' respectively.
  46. ifndef::git-format-patch[]
  47. --raw::
  48. ifndef::git-log[]
  49. Generate the diff in raw format.
  50. ifdef::git-diff-core[]
  51. This is the default.
  52. endif::git-diff-core[]
  53. endif::git-log[]
  54. ifdef::git-log[]
  55. For each commit, show a summary of changes using the raw diff
  56. format. See the "RAW OUTPUT FORMAT" section of
  57. linkgit:git-diff[1]. This is different from showing the log
  58. itself in raw format, which you can achieve with
  59. `--format=raw`.
  60. endif::git-log[]
  61. endif::git-format-patch[]
  62. ifndef::git-format-patch[]
  63. --patch-with-raw::
  64. Synonym for `-p --raw`.
  65. endif::git-format-patch[]
  66. ifdef::git-log[]
  67. -t::
  68. Show the tree objects in the diff output.
  69. endif::git-log[]
  70. --indent-heuristic::
  71. Enable the heuristic that shifts diff hunk boundaries to make patches
  72. easier to read. This is the default.
  73. --no-indent-heuristic::
  74. Disable the indent heuristic.
  75. --minimal::
  76. Spend extra time to make sure the smallest possible
  77. diff is produced.
  78. --patience::
  79. Generate a diff using the "patience diff" algorithm.
  80. --histogram::
  81. Generate a diff using the "histogram diff" algorithm.
  82. --anchored=<text>::
  83. Generate a diff using the "anchored diff" algorithm.
  84. +
  85. This option may be specified more than once.
  86. +
  87. If a line exists in both the source and destination, exists only once,
  88. and starts with this text, this algorithm attempts to prevent it from
  89. appearing as a deletion or addition in the output. It uses the "patience
  90. diff" algorithm internally.
  91. --diff-algorithm={patience|minimal|histogram|myers}::
  92. Choose a diff algorithm. The variants are as follows:
  93. +
  94. --
  95. `default`, `myers`;;
  96. The basic greedy diff algorithm. Currently, this is the default.
  97. `minimal`;;
  98. Spend extra time to make sure the smallest possible diff is
  99. produced.
  100. `patience`;;
  101. Use "patience diff" algorithm when generating patches.
  102. `histogram`;;
  103. This algorithm extends the patience algorithm to "support
  104. low-occurrence common elements".
  105. --
  106. +
  107. For instance, if you configured the `diff.algorithm` variable to a
  108. non-default value and want to use the default one, then you
  109. have to use `--diff-algorithm=default` option.
  110. --stat[=<width>[,<name-width>[,<count>]]]::
  111. Generate a diffstat. By default, as much space as necessary
  112. will be used for the filename part, and the rest for the graph
  113. part. Maximum width defaults to terminal width, or 80 columns
  114. if not connected to a terminal, and can be overridden by
  115. `<width>`. The width of the filename part can be limited by
  116. giving another width `<name-width>` after a comma. The width
  117. of the graph part can be limited by using
  118. `--stat-graph-width=<width>` (affects all commands generating
  119. a stat graph) or by setting `diff.statGraphWidth=<width>`
  120. (does not affect `git format-patch`).
  121. By giving a third parameter `<count>`, you can limit the
  122. output to the first `<count>` lines, followed by `...` if
  123. there are more.
  124. +
  125. These parameters can also be set individually with `--stat-width=<width>`,
  126. `--stat-name-width=<name-width>` and `--stat-count=<count>`.
  127. --compact-summary::
  128. Output a condensed summary of extended header information such
  129. as file creations or deletions ("new" or "gone", optionally "+l"
  130. if it's a symlink) and mode changes ("+x" or "-x" for adding
  131. or removing executable bit respectively) in diffstat. The
  132. information is put between the filename part and the graph
  133. part. Implies `--stat`.
  134. --numstat::
  135. Similar to `--stat`, but shows number of added and
  136. deleted lines in decimal notation and pathname without
  137. abbreviation, to make it more machine friendly. For
  138. binary files, outputs two `-` instead of saying
  139. `0 0`.
  140. --shortstat::
  141. Output only the last line of the `--stat` format containing total
  142. number of modified files, as well as number of added and deleted
  143. lines.
  144. -X[<param1,param2,...>]::
  145. --dirstat[=<param1,param2,...>]::
  146. Output the distribution of relative amount of changes for each
  147. sub-directory. The behavior of `--dirstat` can be customized by
  148. passing it a comma separated list of parameters.
  149. The defaults are controlled by the `diff.dirstat` configuration
  150. variable (see linkgit:git-config[1]).
  151. The following parameters are available:
  152. +
  153. --
  154. `changes`;;
  155. Compute the dirstat numbers by counting the lines that have been
  156. removed from the source, or added to the destination. This ignores
  157. the amount of pure code movements within a file. In other words,
  158. rearranging lines in a file is not counted as much as other changes.
  159. This is the default behavior when no parameter is given.
  160. `lines`;;
  161. Compute the dirstat numbers by doing the regular line-based diff
  162. analysis, and summing the removed/added line counts. (For binary
  163. files, count 64-byte chunks instead, since binary files have no
  164. natural concept of lines). This is a more expensive `--dirstat`
  165. behavior than the `changes` behavior, but it does count rearranged
  166. lines within a file as much as other changes. The resulting output
  167. is consistent with what you get from the other `--*stat` options.
  168. `files`;;
  169. Compute the dirstat numbers by counting the number of files changed.
  170. Each changed file counts equally in the dirstat analysis. This is
  171. the computationally cheapest `--dirstat` behavior, since it does
  172. not have to look at the file contents at all.
  173. `cumulative`;;
  174. Count changes in a child directory for the parent directory as well.
  175. Note that when using `cumulative`, the sum of the percentages
  176. reported may exceed 100%. The default (non-cumulative) behavior can
  177. be specified with the `noncumulative` parameter.
  178. <limit>;;
  179. An integer parameter specifies a cut-off percent (3% by default).
  180. Directories contributing less than this percentage of the changes
  181. are not shown in the output.
  182. --
  183. +
  184. Example: The following will count changed files, while ignoring
  185. directories with less than 10% of the total amount of changed files,
  186. and accumulating child directory counts in the parent directories:
  187. `--dirstat=files,10,cumulative`.
  188. --cumulative::
  189. Synonym for --dirstat=cumulative
  190. --dirstat-by-file[=<param1,param2>...]::
  191. Synonym for --dirstat=files,param1,param2...
  192. --summary::
  193. Output a condensed summary of extended header information
  194. such as creations, renames and mode changes.
  195. ifndef::git-format-patch[]
  196. --patch-with-stat::
  197. Synonym for `-p --stat`.
  198. endif::git-format-patch[]
  199. ifndef::git-format-patch[]
  200. -z::
  201. ifdef::git-log[]
  202. Separate the commits with NULs instead of with new newlines.
  203. +
  204. Also, when `--raw` or `--numstat` has been given, do not munge
  205. pathnames and use NULs as output field terminators.
  206. endif::git-log[]
  207. ifndef::git-log[]
  208. When `--raw`, `--numstat`, `--name-only` or `--name-status` has been
  209. given, do not munge pathnames and use NULs as output field terminators.
  210. endif::git-log[]
  211. +
  212. Without this option, pathnames with "unusual" characters are quoted as
  213. explained for the configuration variable `core.quotePath` (see
  214. linkgit:git-config[1]).
  215. --name-only::
  216. Show only names of changed files.
  217. --name-status::
  218. Show only names and status of changed files. See the description
  219. of the `--diff-filter` option on what the status letters mean.
  220. --submodule[=<format>]::
  221. Specify how differences in submodules are shown. When specifying
  222. `--submodule=short` the 'short' format is used. This format just
  223. shows the names of the commits at the beginning and end of the range.
  224. When `--submodule` or `--submodule=log` is specified, the 'log'
  225. format is used. This format lists the commits in the range like
  226. linkgit:git-submodule[1] `summary` does. When `--submodule=diff`
  227. is specified, the 'diff' format is used. This format shows an
  228. inline diff of the changes in the submodule contents between the
  229. commit range. Defaults to `diff.submodule` or the 'short' format
  230. if the config option is unset.
  231. --color[=<when>]::
  232. Show colored diff.
  233. `--color` (i.e. without '=<when>') is the same as `--color=always`.
  234. '<when>' can be one of `always`, `never`, or `auto`.
  235. ifdef::git-diff[]
  236. It can be changed by the `color.ui` and `color.diff`
  237. configuration settings.
  238. endif::git-diff[]
  239. --no-color::
  240. Turn off colored diff.
  241. ifdef::git-diff[]
  242. This can be used to override configuration settings.
  243. endif::git-diff[]
  244. It is the same as `--color=never`.
  245. --color-moved[=<mode>]::
  246. Moved lines of code are colored differently.
  247. ifdef::git-diff[]
  248. It can be changed by the `diff.colorMoved` configuration setting.
  249. endif::git-diff[]
  250. The <mode> defaults to 'no' if the option is not given
  251. and to 'zebra' if the option with no mode is given.
  252. The mode must be one of:
  253. +
  254. --
  255. no::
  256. Moved lines are not highlighted.
  257. default::
  258. Is a synonym for `zebra`. This may change to a more sensible mode
  259. in the future.
  260. plain::
  261. Any line that is added in one location and was removed
  262. in another location will be colored with 'color.diff.newMoved'.
  263. Similarly 'color.diff.oldMoved' will be used for removed lines
  264. that are added somewhere else in the diff. This mode picks up any
  265. moved line, but it is not very useful in a review to determine
  266. if a block of code was moved without permutation.
  267. blocks::
  268. Blocks of moved text of at least 20 alphanumeric characters
  269. are detected greedily. The detected blocks are
  270. painted using either the 'color.diff.{old,new}Moved' color.
  271. Adjacent blocks cannot be told apart.
  272. zebra::
  273. Blocks of moved text are detected as in 'blocks' mode. The blocks
  274. are painted using either the 'color.diff.{old,new}Moved' color or
  275. 'color.diff.{old,new}MovedAlternative'. The change between
  276. the two colors indicates that a new block was detected.
  277. dimmed-zebra::
  278. Similar to 'zebra', but additional dimming of uninteresting parts
  279. of moved code is performed. The bordering lines of two adjacent
  280. blocks are considered interesting, the rest is uninteresting.
  281. `dimmed_zebra` is a deprecated synonym.
  282. --
  283. --no-color-moved::
  284. Turn off move detection. This can be used to override configuration
  285. settings. It is the same as `--color-moved=no`.
  286. --color-moved-ws=<modes>::
  287. This configures how whitespace is ignored when performing the
  288. move detection for `--color-moved`.
  289. ifdef::git-diff[]
  290. It can be set by the `diff.colorMovedWS` configuration setting.
  291. endif::git-diff[]
  292. These modes can be given as a comma separated list:
  293. +
  294. --
  295. no::
  296. Do not ignore whitespace when performing move detection.
  297. ignore-space-at-eol::
  298. Ignore changes in whitespace at EOL.
  299. ignore-space-change::
  300. Ignore changes in amount of whitespace. This ignores whitespace
  301. at line end, and considers all other sequences of one or
  302. more whitespace characters to be equivalent.
  303. ignore-all-space::
  304. Ignore whitespace when comparing lines. This ignores differences
  305. even if one line has whitespace where the other line has none.
  306. allow-indentation-change::
  307. Initially ignore any whitespace in the move detection, then
  308. group the moved code blocks only into a block if the change in
  309. whitespace is the same per line. This is incompatible with the
  310. other modes.
  311. --
  312. --no-color-moved-ws::
  313. Do not ignore whitespace when performing move detection. This can be
  314. used to override configuration settings. It is the same as
  315. `--color-moved-ws=no`.
  316. --word-diff[=<mode>]::
  317. Show a word diff, using the <mode> to delimit changed words.
  318. By default, words are delimited by whitespace; see
  319. `--word-diff-regex` below. The <mode> defaults to 'plain', and
  320. must be one of:
  321. +
  322. --
  323. color::
  324. Highlight changed words using only colors. Implies `--color`.
  325. plain::
  326. Show words as `[-removed-]` and `{+added+}`. Makes no
  327. attempts to escape the delimiters if they appear in the input,
  328. so the output may be ambiguous.
  329. porcelain::
  330. Use a special line-based format intended for script
  331. consumption. Added/removed/unchanged runs are printed in the
  332. usual unified diff format, starting with a `+`/`-`/` `
  333. character at the beginning of the line and extending to the
  334. end of the line. Newlines in the input are represented by a
  335. tilde `~` on a line of its own.
  336. none::
  337. Disable word diff again.
  338. --
  339. +
  340. Note that despite the name of the first mode, color is used to
  341. highlight the changed parts in all modes if enabled.
  342. --word-diff-regex=<regex>::
  343. Use <regex> to decide what a word is, instead of considering
  344. runs of non-whitespace to be a word. Also implies
  345. `--word-diff` unless it was already enabled.
  346. +
  347. Every non-overlapping match of the
  348. <regex> is considered a word. Anything between these matches is
  349. considered whitespace and ignored(!) for the purposes of finding
  350. differences. You may want to append `|[^[:space:]]` to your regular
  351. expression to make sure that it matches all non-whitespace characters.
  352. A match that contains a newline is silently truncated(!) at the
  353. newline.
  354. +
  355. For example, `--word-diff-regex=.` will treat each character as a word
  356. and, correspondingly, show differences character by character.
  357. +
  358. The regex can also be set via a diff driver or configuration option, see
  359. linkgit:gitattributes[5] or linkgit:git-config[1]. Giving it explicitly
  360. overrides any diff driver or configuration setting. Diff drivers
  361. override configuration settings.
  362. --color-words[=<regex>]::
  363. Equivalent to `--word-diff=color` plus (if a regex was
  364. specified) `--word-diff-regex=<regex>`.
  365. endif::git-format-patch[]
  366. --no-renames::
  367. Turn off rename detection, even when the configuration
  368. file gives the default to do so.
  369. --[no-]rename-empty::
  370. Whether to use empty blobs as rename source.
  371. ifndef::git-format-patch[]
  372. --check::
  373. Warn if changes introduce conflict markers or whitespace errors.
  374. What are considered whitespace errors is controlled by `core.whitespace`
  375. configuration. By default, trailing whitespaces (including
  376. lines that consist solely of whitespaces) and a space character
  377. that is immediately followed by a tab character inside the
  378. initial indent of the line are considered whitespace errors.
  379. Exits with non-zero status if problems are found. Not compatible
  380. with --exit-code.
  381. --ws-error-highlight=<kind>::
  382. Highlight whitespace errors in the `context`, `old` or `new`
  383. lines of the diff. Multiple values are separated by comma,
  384. `none` resets previous values, `default` reset the list to
  385. `new` and `all` is a shorthand for `old,new,context`. When
  386. this option is not given, and the configuration variable
  387. `diff.wsErrorHighlight` is not set, only whitespace errors in
  388. `new` lines are highlighted. The whitespace errors are colored
  389. with `color.diff.whitespace`.
  390. endif::git-format-patch[]
  391. --full-index::
  392. Instead of the first handful of characters, show the full
  393. pre- and post-image blob object names on the "index"
  394. line when generating patch format output.
  395. --binary::
  396. In addition to `--full-index`, output a binary diff that
  397. can be applied with `git-apply`. Implies `--patch`.
  398. --abbrev[=<n>]::
  399. Instead of showing the full 40-byte hexadecimal object
  400. name in diff-raw format output and diff-tree header
  401. lines, show only a partial prefix.
  402. In diff-patch output format, `--full-index` takes higher
  403. precedence, i.e. if `--full-index` is specified, full blob
  404. names will be shown regardless of `--abbrev`.
  405. Non default number of digits can be specified with `--abbrev=<n>`.
  406. -B[<n>][/<m>]::
  407. --break-rewrites[=[<n>][/<m>]]::
  408. Break complete rewrite changes into pairs of delete and
  409. create. This serves two purposes:
  410. +
  411. It affects the way a change that amounts to a total rewrite of a file
  412. not as a series of deletion and insertion mixed together with a very
  413. few lines that happen to match textually as the context, but as a
  414. single deletion of everything old followed by a single insertion of
  415. everything new, and the number `m` controls this aspect of the -B
  416. option (defaults to 60%). `-B/70%` specifies that less than 30% of the
  417. original should remain in the result for Git to consider it a total
  418. rewrite (i.e. otherwise the resulting patch will be a series of
  419. deletion and insertion mixed together with context lines).
  420. +
  421. When used with -M, a totally-rewritten file is also considered as the
  422. source of a rename (usually -M only considers a file that disappeared
  423. as the source of a rename), and the number `n` controls this aspect of
  424. the -B option (defaults to 50%). `-B20%` specifies that a change with
  425. addition and deletion compared to 20% or more of the file's size are
  426. eligible for being picked up as a possible source of a rename to
  427. another file.
  428. -M[<n>]::
  429. --find-renames[=<n>]::
  430. ifndef::git-log[]
  431. Detect renames.
  432. endif::git-log[]
  433. ifdef::git-log[]
  434. If generating diffs, detect and report renames for each commit.
  435. For following files across renames while traversing history, see
  436. `--follow`.
  437. endif::git-log[]
  438. If `n` is specified, it is a threshold on the similarity
  439. index (i.e. amount of addition/deletions compared to the
  440. file's size). For example, `-M90%` means Git should consider a
  441. delete/add pair to be a rename if more than 90% of the file
  442. hasn't changed. Without a `%` sign, the number is to be read as
  443. a fraction, with a decimal point before it. I.e., `-M5` becomes
  444. 0.5, and is thus the same as `-M50%`. Similarly, `-M05` is
  445. the same as `-M5%`. To limit detection to exact renames, use
  446. `-M100%`. The default similarity index is 50%.
  447. -C[<n>]::
  448. --find-copies[=<n>]::
  449. Detect copies as well as renames. See also `--find-copies-harder`.
  450. If `n` is specified, it has the same meaning as for `-M<n>`.
  451. --find-copies-harder::
  452. For performance reasons, by default, `-C` option finds copies only
  453. if the original file of the copy was modified in the same
  454. changeset. This flag makes the command
  455. inspect unmodified files as candidates for the source of
  456. copy. This is a very expensive operation for large
  457. projects, so use it with caution. Giving more than one
  458. `-C` option has the same effect.
  459. -D::
  460. --irreversible-delete::
  461. Omit the preimage for deletes, i.e. print only the header but not
  462. the diff between the preimage and `/dev/null`. The resulting patch
  463. is not meant to be applied with `patch` or `git apply`; this is
  464. solely for people who want to just concentrate on reviewing the
  465. text after the change. In addition, the output obviously lacks
  466. enough information to apply such a patch in reverse, even manually,
  467. hence the name of the option.
  468. +
  469. When used together with `-B`, omit also the preimage in the deletion part
  470. of a delete/create pair.
  471. -l<num>::
  472. The `-M` and `-C` options require O(n^2) processing time where n
  473. is the number of potential rename/copy targets. This
  474. option prevents rename/copy detection from running if
  475. the number of rename/copy targets exceeds the specified
  476. number.
  477. ifndef::git-format-patch[]
  478. --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]::
  479. Select only files that are Added (`A`), Copied (`C`),
  480. Deleted (`D`), Modified (`M`), Renamed (`R`), have their
  481. type (i.e. regular file, symlink, submodule, ...) changed (`T`),
  482. are Unmerged (`U`), are
  483. Unknown (`X`), or have had their pairing Broken (`B`).
  484. Any combination of the filter characters (including none) can be used.
  485. When `*` (All-or-none) is added to the combination, all
  486. paths are selected if there is any file that matches
  487. other criteria in the comparison; if there is no file
  488. that matches other criteria, nothing is selected.
  489. +
  490. Also, these upper-case letters can be downcased to exclude. E.g.
  491. `--diff-filter=ad` excludes added and deleted paths.
  492. +
  493. Note that not all diffs can feature all types. For instance, diffs
  494. from the index to the working tree can never have Added entries
  495. (because the set of paths included in the diff is limited by what is in
  496. the index). Similarly, copied and renamed entries cannot appear if
  497. detection for those types is disabled.
  498. -S<string>::
  499. Look for differences that change the number of occurrences of
  500. the specified string (i.e. addition/deletion) in a file.
  501. Intended for the scripter's use.
  502. +
  503. It is useful when you're looking for an exact block of code (like a
  504. struct), and want to know the history of that block since it first
  505. came into being: use the feature iteratively to feed the interesting
  506. block in the preimage back into `-S`, and keep going until you get the
  507. very first version of the block.
  508. +
  509. Binary files are searched as well.
  510. -G<regex>::
  511. Look for differences whose patch text contains added/removed
  512. lines that match <regex>.
  513. +
  514. To illustrate the difference between `-S<regex> --pickaxe-regex` and
  515. `-G<regex>`, consider a commit with the following diff in the same
  516. file:
  517. +
  518. ----
  519. + return frotz(nitfol, two->ptr, 1, 0);
  520. ...
  521. - hit = frotz(nitfol, mf2.ptr, 1, 0);
  522. ----
  523. +
  524. While `git log -G"frotz\(nitfol"` will show this commit, `git log
  525. -S"frotz\(nitfol" --pickaxe-regex` will not (because the number of
  526. occurrences of that string did not change).
  527. +
  528. Unless `--text` is supplied patches of binary files without a textconv
  529. filter will be ignored.
  530. +
  531. See the 'pickaxe' entry in linkgit:gitdiffcore[7] for more
  532. information.
  533. --find-object=<object-id>::
  534. Look for differences that change the number of occurrences of
  535. the specified object. Similar to `-S`, just the argument is different
  536. in that it doesn't search for a specific string but for a specific
  537. object id.
  538. +
  539. The object can be a blob or a submodule commit. It implies the `-t` option in
  540. `git-log` to also find trees.
  541. --pickaxe-all::
  542. When `-S` or `-G` finds a change, show all the changes in that
  543. changeset, not just the files that contain the change
  544. in <string>.
  545. --pickaxe-regex::
  546. Treat the <string> given to `-S` as an extended POSIX regular
  547. expression to match.
  548. endif::git-format-patch[]
  549. -O<orderfile>::
  550. Control the order in which files appear in the output.
  551. This overrides the `diff.orderFile` configuration variable
  552. (see linkgit:git-config[1]). To cancel `diff.orderFile`,
  553. use `-O/dev/null`.
  554. +
  555. The output order is determined by the order of glob patterns in
  556. <orderfile>.
  557. All files with pathnames that match the first pattern are output
  558. first, all files with pathnames that match the second pattern (but not
  559. the first) are output next, and so on.
  560. All files with pathnames that do not match any pattern are output
  561. last, as if there was an implicit match-all pattern at the end of the
  562. file.
  563. If multiple pathnames have the same rank (they match the same pattern
  564. but no earlier patterns), their output order relative to each other is
  565. the normal order.
  566. +
  567. <orderfile> is parsed as follows:
  568. +
  569. --
  570. - Blank lines are ignored, so they can be used as separators for
  571. readability.
  572. - Lines starting with a hash ("`#`") are ignored, so they can be used
  573. for comments. Add a backslash ("`\`") to the beginning of the
  574. pattern if it starts with a hash.
  575. - Each other line contains a single pattern.
  576. --
  577. +
  578. Patterns have the same syntax and semantics as patterns used for
  579. fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
  580. matches a pattern if removing any number of the final pathname
  581. components matches the pattern. For example, the pattern "`foo*bar`"
  582. matches "`fooasdfbar`" and "`foo/bar/baz/asdf`" but not "`foobarx`".
  583. ifndef::git-format-patch[]
  584. -R::
  585. Swap two inputs; that is, show differences from index or
  586. on-disk file to tree contents.
  587. endif::git-format-patch[]
  588. --relative[=<path>]::
  589. --no-relative::
  590. When run from a subdirectory of the project, it can be
  591. told to exclude changes outside the directory and show
  592. pathnames relative to it with this option. When you are
  593. not in a subdirectory (e.g. in a bare repository), you
  594. can name which subdirectory to make the output relative
  595. to by giving a <path> as an argument.
  596. `--no-relative` can be used to countermand both `diff.relative` config
  597. option and previous `--relative`.
  598. -a::
  599. --text::
  600. Treat all files as text.
  601. --ignore-cr-at-eol::
  602. Ignore carriage-return at the end of line when doing a comparison.
  603. --ignore-space-at-eol::
  604. Ignore changes in whitespace at EOL.
  605. -b::
  606. --ignore-space-change::
  607. Ignore changes in amount of whitespace. This ignores whitespace
  608. at line end, and considers all other sequences of one or
  609. more whitespace characters to be equivalent.
  610. -w::
  611. --ignore-all-space::
  612. Ignore whitespace when comparing lines. This ignores
  613. differences even if one line has whitespace where the other
  614. line has none.
  615. --ignore-blank-lines::
  616. Ignore changes whose lines are all blank.
  617. --inter-hunk-context=<lines>::
  618. Show the context between diff hunks, up to the specified number
  619. of lines, thereby fusing hunks that are close to each other.
  620. Defaults to `diff.interHunkContext` or 0 if the config option
  621. is unset.
  622. -W::
  623. --function-context::
  624. Show whole surrounding functions of changes.
  625. ifndef::git-format-patch[]
  626. ifndef::git-log[]
  627. --exit-code::
  628. Make the program exit with codes similar to diff(1).
  629. That is, it exits with 1 if there were differences and
  630. 0 means no differences.
  631. --quiet::
  632. Disable all output of the program. Implies `--exit-code`.
  633. endif::git-log[]
  634. endif::git-format-patch[]
  635. --ext-diff::
  636. Allow an external diff helper to be executed. If you set an
  637. external diff driver with linkgit:gitattributes[5], you need
  638. to use this option with linkgit:git-log[1] and friends.
  639. --no-ext-diff::
  640. Disallow external diff drivers.
  641. --textconv::
  642. --no-textconv::
  643. Allow (or disallow) external text conversion filters to be run
  644. when comparing binary files. See linkgit:gitattributes[5] for
  645. details. Because textconv filters are typically a one-way
  646. conversion, the resulting diff is suitable for human
  647. consumption, but cannot be applied. For this reason, textconv
  648. filters are enabled by default only for linkgit:git-diff[1] and
  649. linkgit:git-log[1], but not for linkgit:git-format-patch[1] or
  650. diff plumbing commands.
  651. --ignore-submodules[=<when>]::
  652. Ignore changes to submodules in the diff generation. <when> can be
  653. either "none", "untracked", "dirty" or "all", which is the default.
  654. Using "none" will consider the submodule modified when it either contains
  655. untracked or modified files or its HEAD differs from the commit recorded
  656. in the superproject and can be used to override any settings of the
  657. 'ignore' option in linkgit:git-config[1] or linkgit:gitmodules[5]. When
  658. "untracked" is used submodules are not considered dirty when they only
  659. contain untracked content (but they are still scanned for modified
  660. content). Using "dirty" ignores all changes to the work tree of submodules,
  661. only changes to the commits stored in the superproject are shown (this was
  662. the behavior until 1.7.0). Using "all" hides all changes to submodules.
  663. --src-prefix=<prefix>::
  664. Show the given source prefix instead of "a/".
  665. --dst-prefix=<prefix>::
  666. Show the given destination prefix instead of "b/".
  667. --no-prefix::
  668. Do not show any source or destination prefix.
  669. --line-prefix=<prefix>::
  670. Prepend an additional prefix to every line of output.
  671. --ita-invisible-in-index::
  672. By default entries added by "git add -N" appear as an existing
  673. empty file in "git diff" and a new file in "git diff --cached".
  674. This option makes the entry appear as a new file in "git diff"
  675. and non-existent in "git diff --cached". This option could be
  676. reverted with `--ita-visible-in-index`. Both options are
  677. experimental and could be removed in future.
  678. For more detailed explanation on these common options, see also
  679. linkgit:gitdiffcore[7].