]>
Commit | Line | Data |
---|---|---|
dda2d79a JH |
1 | -p:: |
2 | Generate patch (see section on generating patches) | |
3 | ||
4 | -u:: | |
5 | Synonym for "-p". | |
6 | ||
4eb99473 RR |
7 | -U<n>:: |
8 | Shorthand for "--unified=<n>". | |
9 | ||
10 | --unified=<n>:: | |
11 | Generate diffs with <n> lines of context instead of | |
12 | the usual three. Implies "-p". | |
13 | ||
b5376648 JH |
14 | --raw:: |
15 | Generate the raw format. | |
16 | ||
5c91da25 | 17 | --patch-with-raw:: |
b5376648 | 18 | Synonym for "-p --raw". |
5c91da25 | 19 | |
5c5b2ea9 LT |
20 | --stat[=width[,name-width]]:: |
21 | Generate a diffstat. You can override the default | |
22 | output width for 80-column terminal by "--stat=width". | |
23 | The width of the filename part can be controlled by | |
24 | giving another width to it separated by a comma. | |
d75f7952 | 25 | |
74e2abe5 JH |
26 | --numstat:: |
27 | Similar to \--stat, but shows number of added and | |
28 | deleted lines in decimal notation and pathname without | |
2f89543e JH |
29 | abbreviation, to make it more machine friendly. For |
30 | binary files, outputs two `-` instead of saying | |
31 | `0 0`. | |
74e2abe5 | 32 | |
ebd124c6 NP |
33 | --shortstat:: |
34 | Output only the last line of the --stat format containing total | |
35 | number of modified files, as well as number of added and deleted | |
36 | lines. | |
37 | ||
4bbd261b SE |
38 | --summary:: |
39 | Output a condensed summary of extended header information | |
40 | such as creations, renames and mode changes. | |
41 | ||
29353273 | 42 | --patch-with-stat:: |
b5376648 | 43 | Synonym for "-p --stat". |
29353273 | 44 | |
dda2d79a JH |
45 | -z:: |
46 | \0 line termination on output | |
47 | ||
48 | --name-only:: | |
49 | Show only names of changed files. | |
50 | ||
946f5f7c JH |
51 | --name-status:: |
52 | Show only names and status of changed files. | |
dda2d79a | 53 | |
b5376648 JH |
54 | --color:: |
55 | Show colored diff. | |
56 | ||
57 | --no-color:: | |
58 | Turn off colored diff, even when the configuration file | |
59 | gives the default to color output. | |
60 | ||
f59a59e2 JS |
61 | --color-words:: |
62 | Show colored word diff, i.e. color words which have changed. | |
63 | ||
b5376648 JH |
64 | --no-renames:: |
65 | Turn off rename detection, even when the configuration | |
66 | file gives the default to do so. | |
67 | ||
16507fcf BL |
68 | --check:: |
69 | Warn if changes introduce trailing whitespace | |
70 | or an indent that uses a space before a tab. | |
71 | ||
80b1e511 JH |
72 | --full-index:: |
73 | Instead of the first handful characters, show full | |
74 | object name of pre- and post-image blob on the "index" | |
b5376648 JH |
75 | line when generating a patch format output. |
76 | ||
77 | --binary:: | |
78 | In addition to --full-index, output "binary diff" that | |
79 | can be applied with "git apply". | |
80b1e511 | 80 | |
913419fc | 81 | --abbrev[=<n>]:: |
47dd0d59 JH |
82 | Instead of showing the full 40-byte hexadecimal object |
83 | name in diff-raw format output and diff-tree header | |
89438677 | 84 | lines, show only handful hexdigits prefix. This is |
913419fc JH |
85 | independent of --full-index option above, which controls |
86 | the diff-patch output format. Non default number of | |
87 | digits can be specified with --abbrev=<n>. | |
47dd0d59 | 88 | |
dda2d79a JH |
89 | -B:: |
90 | Break complete rewrite changes into pairs of delete and create. | |
91 | ||
92 | -M:: | |
93 | Detect renames. | |
94 | ||
95 | -C:: | |
ca6c0970 | 96 | Detect copies as well as renames. See also `--find-copies-harder`. |
dda2d79a | 97 | |
147cf317 JL |
98 | --diff-filter=[ACDMRTUXB*]:: |
99 | Select only files that are Added (`A`), Copied (`C`), | |
100 | Deleted (`D`), Modified (`M`), Renamed (`R`), have their | |
101 | type (mode) changed (`T`), are Unmerged (`U`), are | |
102 | Unknown (`X`), or have had their pairing Broken (`B`). | |
103 | Any combination of the filter characters may be used. | |
104 | When `*` (All-or-none) is added to the combination, all | |
105 | paths are selected if there is any file that matches | |
106 | other criteria in the comparison; if there is no file | |
107 | that matches other criteria, nothing is selected. | |
108 | ||
dda2d79a | 109 | --find-copies-harder:: |
ca6c0970 | 110 | For performance reasons, by default, `-C` option finds copies only |
a6080a0a | 111 | if the original file of the copy was modified in the same |
f73ae1fc | 112 | changeset. This flag makes the command |
dda2d79a JH |
113 | inspect unmodified files as candidates for the source of |
114 | copy. This is a very expensive operation for large | |
ca6c0970 JS |
115 | projects, so use it with caution. Giving more than one |
116 | `-C` option has the same effect. | |
dda2d79a | 117 | |
8082d8d3 JH |
118 | -l<num>:: |
119 | -M and -C options require O(n^2) processing time where n | |
f73ae1fc | 120 | is the number of potential rename/copy targets. This |
8082d8d3 | 121 | option prevents rename/copy detection from running if |
f73ae1fc | 122 | the number of rename/copy targets exceeds the specified |
8082d8d3 JH |
123 | number. |
124 | ||
dda2d79a | 125 | -S<string>:: |
f73ae1fc | 126 | Look for differences that contain the change in <string>. |
dda2d79a JH |
127 | |
128 | --pickaxe-all:: | |
129 | When -S finds a change, show all the changes in that | |
f73ae1fc | 130 | changeset, not just the files that contain the change |
dda2d79a JH |
131 | in <string>. |
132 | ||
d01d8c67 PB |
133 | --pickaxe-regex:: |
134 | Make the <string> not a plain string but an extended POSIX | |
135 | regex to match. | |
136 | ||
dda2d79a JH |
137 | -O<orderfile>:: |
138 | Output the patch in the order specified in the | |
139 | <orderfile>, which has one shell glob pattern per line. | |
140 | ||
141 | -R:: | |
5f3aa197 | 142 | Swap two inputs; that is, show differences from index or |
dda2d79a JH |
143 | on-disk file to tree contents. |
144 | ||
d507bb15 SF |
145 | --text:: |
146 | Treat all files as text. | |
147 | ||
148 | -a:: | |
149 | Shorthand for "--text". | |
150 | ||
a44a0c99 JH |
151 | --ignore-space-at-eol:: |
152 | Ignore changes in white spaces at EOL. | |
153 | ||
8ebe185b JN |
154 | --ignore-space-change:: |
155 | Ignore changes in amount of white space. This ignores white | |
156 | space at line end, and consider all other sequences of one or | |
157 | more white space characters to be equivalent. | |
158 | ||
159 | -b:: | |
160 | Shorthand for "--ignore-space-change". | |
161 | ||
162 | --ignore-all-space:: | |
163 | Ignore white space when comparing lines. This ignores | |
164 | difference even if one line has white space where the other | |
165 | line has none. | |
166 | ||
167 | -w:: | |
168 | Shorthand for "--ignore-all-space". | |
169 | ||
41bbf9d5 AR |
170 | --exit-code:: |
171 | Make the program exit with codes similar to diff(1). | |
172 | That is, it exits with 1 if there were differences and | |
173 | 0 means no differences. | |
174 | ||
2a18c266 AR |
175 | --quiet:: |
176 | Disable all output of the program. Implies --exit-code. | |
177 | ||
72909bef JS |
178 | --ext-diff:: |
179 | Allow an external diff helper to be executed. If you set an | |
180 | external diff driver with gitlink:gitattributes(5), you need | |
181 | to use this option with gitlink:git-log(1) and friends. | |
182 | ||
183 | --no-ext-diff:: | |
184 | Disallow external diff drivers. | |
185 | ||
8db9307c JH |
186 | For more detailed explanation on these common options, see also |
187 | link:diffcore.html[diffcore documentation]. |