Merge branch 'maint'
[git/git.git] / Documentation / diff-options.txt
1 -p::
2 Generate patch (see section on generating patches)
3
4 -u::
5 Synonym for "-p".
6
7 --raw::
8 Generate the raw format.
9
10 --patch-with-raw::
11 Synonym for "-p --raw".
12
13 --stat[=width[,name-width]]::
14 Generate a diffstat. You can override the default
15 output width for 80-column terminal by "--stat=width".
16 The width of the filename part can be controlled by
17 giving another width to it separated by a comma.
18
19 --numstat::
20 Similar to \--stat, but shows number of added and
21 deleted lines in decimal notation and pathname without
22 abbreviation, to make it more machine friendly.
23
24 --shortstat::
25 Output only the last line of the --stat format containing total
26 number of modified files, as well as number of added and deleted
27 lines.
28
29 --summary::
30 Output a condensed summary of extended header information
31 such as creations, renames and mode changes.
32
33 --patch-with-stat::
34 Synonym for "-p --stat".
35
36 -z::
37 \0 line termination on output
38
39 --name-only::
40 Show only names of changed files.
41
42 --name-status::
43 Show only names and status of changed files.
44
45 --color::
46 Show colored diff.
47
48 --no-color::
49 Turn off colored diff, even when the configuration file
50 gives the default to color output.
51
52 --color-words::
53 Show colored word diff, i.e. color words which have changed.
54
55 --no-renames::
56 Turn off rename detection, even when the configuration
57 file gives the default to do so.
58
59 --full-index::
60 Instead of the first handful characters, show full
61 object name of pre- and post-image blob on the "index"
62 line when generating a patch format output.
63
64 --binary::
65 In addition to --full-index, output "binary diff" that
66 can be applied with "git apply".
67
68 --abbrev[=<n>]::
69 Instead of showing the full 40-byte hexadecimal object
70 name in diff-raw format output and diff-tree header
71 lines, show only handful hexdigits prefix. This is
72 independent of --full-index option above, which controls
73 the diff-patch output format. Non default number of
74 digits can be specified with --abbrev=<n>.
75
76 -B::
77 Break complete rewrite changes into pairs of delete and create.
78
79 -M::
80 Detect renames.
81
82 -C::
83 Detect copies as well as renames.
84
85 --diff-filter=[ACDMRTUXB*]::
86 Select only files that are Added (`A`), Copied (`C`),
87 Deleted (`D`), Modified (`M`), Renamed (`R`), have their
88 type (mode) changed (`T`), are Unmerged (`U`), are
89 Unknown (`X`), or have had their pairing Broken (`B`).
90 Any combination of the filter characters may be used.
91 When `*` (All-or-none) is added to the combination, all
92 paths are selected if there is any file that matches
93 other criteria in the comparison; if there is no file
94 that matches other criteria, nothing is selected.
95
96 --find-copies-harder::
97 For performance reasons, by default, -C option finds copies only
98 if the original file of the copy was modified in the same
99 changeset. This flag makes the command
100 inspect unmodified files as candidates for the source of
101 copy. This is a very expensive operation for large
102 projects, so use it with caution.
103
104 -l<num>::
105 -M and -C options require O(n^2) processing time where n
106 is the number of potential rename/copy targets. This
107 option prevents rename/copy detection from running if
108 the number of rename/copy targets exceeds the specified
109 number.
110
111 -S<string>::
112 Look for differences that contain the change in <string>.
113
114 --pickaxe-all::
115 When -S finds a change, show all the changes in that
116 changeset, not just the files that contain the change
117 in <string>.
118
119 --pickaxe-regex::
120 Make the <string> not a plain string but an extended POSIX
121 regex to match.
122
123 -O<orderfile>::
124 Output the patch in the order specified in the
125 <orderfile>, which has one shell glob pattern per line.
126
127 -R::
128 Swap two inputs; that is, show differences from index or
129 on-disk file to tree contents.
130
131 --text::
132 Treat all files as text.
133
134 -a::
135 Shorthand for "--text".
136
137 --ignore-space-change::
138 Ignore changes in amount of white space. This ignores white
139 space at line end, and consider all other sequences of one or
140 more white space characters to be equivalent.
141
142 -b::
143 Shorthand for "--ignore-space-change".
144
145 --ignore-all-space::
146 Ignore white space when comparing lines. This ignores
147 difference even if one line has white space where the other
148 line has none.
149
150 -w::
151 Shorthand for "--ignore-all-space".
152
153 For more detailed explanation on these common options, see also
154 link:diffcore.html[diffcore documentation].