1GIT-SHOW(1)                       Git Manual                       GIT-SHOW(1)
2
3
4

NAME

6       git-show - Show various types of objects
7

SYNOPSIS

9       git show [<options>] [<object>...]
10

DESCRIPTION

12       Shows one or more objects (blobs, trees, tags and commits).
13
14       For commits it shows the log message and textual diff. It also presents
15       the merge commit in a special format as produced by git diff-tree --cc.
16
17       For tags, it shows the tag message and the referenced objects.
18
19       For trees, it shows the names (equivalent to git ls-tree with
20       --name-only).
21
22       For plain blobs, it shows the plain contents.
23
24       The command takes options applicable to the git diff-tree command to
25       control how the changes the commit introduces are shown.
26
27       This manual page describes only the most frequently used options.
28

OPTIONS

30       <object>...
31           The names of objects to show (defaults to HEAD). For a more
32           complete list of ways to spell object names, see "SPECIFYING
33           REVISIONS" section in gitrevisions(7).
34
35       --pretty[=<format>], --format=<format>
36           Pretty-print the contents of the commit logs in a given format,
37           where <format> can be one of oneline, short, medium, full, fuller,
38           reference, email, raw, format:<string> and tformat:<string>. When
39           <format> is none of the above, and has %placeholder in it, it acts
40           as if --pretty=tformat:<format> were given.
41
42           See the "PRETTY FORMATS" section for some additional details for
43           each format. When =<format> part is omitted, it defaults to medium.
44
45           Note: you can specify the default pretty format in the repository
46           configuration (see git-config(1)).
47
48       --abbrev-commit
49           Instead of showing the full 40-byte hexadecimal commit object name,
50           show a prefix that names the object uniquely. "--abbrev=<n>" (which
51           also modifies diff output, if it is displayed) option can be used
52           to specify the minimum length of the prefix.
53
54           This should make "--pretty=oneline" a whole lot more readable for
55           people using 80-column terminals.
56
57       --no-abbrev-commit
58           Show the full 40-byte hexadecimal commit object name. This negates
59           --abbrev-commit, either explicit or implied by other options such
60           as "--oneline". It also overrides the log.abbrevCommit variable.
61
62       --oneline
63           This is a shorthand for "--pretty=oneline --abbrev-commit" used
64           together.
65
66       --encoding=<encoding>
67           The commit objects record the encoding used for the log message in
68           their encoding header; this option can be used to tell the command
69           to re-code the commit log message in the encoding preferred by the
70           user. For non plumbing commands this defaults to UTF-8. Note that
71           if an object claims to be encoded in X and we are outputting in X,
72           we will output the object verbatim; this means that invalid
73           sequences in the original commit may be copied to the output.
74
75       --expand-tabs=<n>, --expand-tabs, --no-expand-tabs
76           Perform a tab expansion (replace each tab with enough spaces to
77           fill to the next display column that is multiple of <n>) in the log
78           message before showing it in the output.  --expand-tabs is a
79           short-hand for --expand-tabs=8, and --no-expand-tabs is a
80           short-hand for --expand-tabs=0, which disables tab expansion.
81
82           By default, tabs are expanded in pretty formats that indent the log
83           message by 4 spaces (i.e.  medium, which is the default, full, and
84           fuller).
85
86       --notes[=<ref>]
87           Show the notes (see git-notes(1)) that annotate the commit, when
88           showing the commit log message. This is the default for git log,
89           git show and git whatchanged commands when there is no --pretty,
90           --format, or --oneline option given on the command line.
91
92           By default, the notes shown are from the notes refs listed in the
93           core.notesRef and notes.displayRef variables (or corresponding
94           environment overrides). See git-config(1) for more details.
95
96           With an optional <ref> argument, use the ref to find the notes to
97           display. The ref can specify the full refname when it begins with
98           refs/notes/; when it begins with notes/, refs/ and otherwise
99           refs/notes/ is prefixed to form a full name of the ref.
100
101           Multiple --notes options can be combined to control which notes are
102           being displayed. Examples: "--notes=foo" will show only notes from
103           "refs/notes/foo"; "--notes=foo --notes" will show both notes from
104           "refs/notes/foo" and from the default notes ref(s).
105
106       --no-notes
107           Do not show notes. This negates the above --notes option, by
108           resetting the list of notes refs from which notes are shown.
109           Options are parsed in the order given on the command line, so e.g.
110           "--notes --notes=foo --no-notes --notes=bar" will only show notes
111           from "refs/notes/bar".
112
113       --show-notes[=<ref>], --[no-]standard-notes
114           These options are deprecated. Use the above --notes/--no-notes
115           options instead.
116
117       --show-signature
118           Check the validity of a signed commit object by passing the
119           signature to gpg --verify and show the output.
120

PRETTY FORMATS

122       If the commit is a merge, and if the pretty-format is not oneline,
123       email or raw, an additional line is inserted before the Author: line.
124       This line begins with "Merge: " and the hashes of ancestral commits are
125       printed, separated by spaces. Note that the listed commits may not
126       necessarily be the list of the direct parent commits if you have
127       limited your view of history: for example, if you are only interested
128       in changes related to a certain directory or file.
129
130       There are several built-in formats, and you can define additional
131       formats by setting a pretty.<name> config option to either another
132       format name, or a format: string, as described below (see git-
133       config(1)). Here are the details of the built-in formats:
134
135oneline
136
137               <hash> <title line>
138
139           This is designed to be as compact as possible.
140
141short
142
143               commit <hash>
144               Author: <author>
145
146               <title line>
147
148medium
149
150               commit <hash>
151               Author: <author>
152               Date:   <author date>
153
154               <title line>
155
156               <full commit message>
157
158full
159
160               commit <hash>
161               Author: <author>
162               Commit: <committer>
163
164               <title line>
165
166               <full commit message>
167
168fuller
169
170               commit <hash>
171               Author:     <author>
172               AuthorDate: <author date>
173               Commit:     <committer>
174               CommitDate: <committer date>
175
176               <title line>
177
178               <full commit message>
179
180reference
181
182               <abbrev hash> (<title line>, <short author date>)
183
184           This format is used to refer to another commit in a commit message
185           and is the same as --pretty='format:%C(auto)%h (%s, %ad)'. By
186           default, the date is formatted with --date=short unless another
187           --date option is explicitly specified. As with any format: with
188           format placeholders, its output is not affected by other options
189           like --decorate and --walk-reflogs.
190
191email
192
193               From <hash> <date>
194               From: <author>
195               Date: <author date>
196               Subject: [PATCH] <title line>
197
198               <full commit message>
199
200mboxrd
201
202           Like email, but lines in the commit message starting with "From "
203           (preceded by zero or more ">") are quoted with ">" so they aren’t
204           confused as starting a new commit.
205
206raw
207
208           The raw format shows the entire commit exactly as stored in the
209           commit object. Notably, the hashes are displayed in full,
210           regardless of whether --abbrev or --no-abbrev are used, and parents
211           information show the true parent commits, without taking grafts or
212           history simplification into account. Note that this format affects
213           the way commits are displayed, but not the way the diff is shown
214           e.g. with git log --raw. To get full object names in a raw diff
215           format, use --no-abbrev.
216
217format:<string>
218
219           The format:<string> format allows you to specify which information
220           you want to show. It works a little bit like printf format, with
221           the notable exception that you get a newline with %n instead of \n.
222
223           E.g, format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"
224           would show something like this:
225
226               The author of fe6e0ee was Junio C Hamano, 23 hours ago
227               The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<
228
229           The placeholders are:
230
231           •   Placeholders that expand to a single literal character:
232
233               %n
234                   newline
235
236               %%
237                   a raw %
238
239               %x00
240                   print a byte from a hex code
241
242           •   Placeholders that affect formatting of later placeholders:
243
244               %Cred
245                   switch color to red
246
247               %Cgreen
248                   switch color to green
249
250               %Cblue
251                   switch color to blue
252
253               %Creset
254                   reset color
255
256               %C(...)
257                   color specification, as described under Values in the
258                   "CONFIGURATION FILE" section of git-config(1). By default,
259                   colors are shown only when enabled for log output (by
260                   color.diff, color.ui, or --color, and respecting the auto
261                   settings of the former if we are going to a terminal).
262                   %C(auto,...)  is accepted as a historical synonym for the
263                   default (e.g., %C(auto,red)). Specifying %C(always,...)
264                   will show the colors even when color is not otherwise
265                   enabled (though consider just using --color=always to
266                   enable color for the whole output, including this format
267                   and anything else git might color).  auto alone (i.e.
268                   %C(auto)) will turn on auto coloring on the next
269                   placeholders until the color is switched again.
270
271               %m
272                   left (<), right (>) or boundary (-) mark
273
274               %w([<w>[,<i1>[,<i2>]]])
275                   switch line wrapping, like the -w option of git-
276                   shortlog(1).
277
278               %<(<N>[,trunc|ltrunc|mtrunc])
279                   make the next placeholder take at least N columns, padding
280                   spaces on the right if necessary. Optionally truncate at
281                   the beginning (ltrunc), the middle (mtrunc) or the end
282                   (trunc) if the output is longer than N columns. Note that
283                   truncating only works correctly with N >= 2.
284
285               %<|(<N>)
286                   make the next placeholder take at least until Nth columns,
287                   padding spaces on the right if necessary
288
289               %>(<N>), %>|(<N>)
290                   similar to %<(<N>), %<|(<N>) respectively, but padding
291                   spaces on the left
292
293               %>>(<N>), %>>|(<N>)
294                   similar to %>(<N>), %>|(<N>) respectively, except that if
295                   the next placeholder takes more spaces than given and there
296                   are spaces on its left, use those spaces
297
298               %><(<N>), %><|(<N>)
299                   similar to %<(<N>), %<|(<N>) respectively, but padding both
300                   sides (i.e. the text is centered)
301
302           •   Placeholders that expand to information extracted from the
303               commit:
304
305               %H
306                   commit hash
307
308               %h
309                   abbreviated commit hash
310
311               %T
312                   tree hash
313
314               %t
315                   abbreviated tree hash
316
317               %P
318                   parent hashes
319
320               %p
321                   abbreviated parent hashes
322
323               %an
324                   author name
325
326               %aN
327                   author name (respecting .mailmap, see git-shortlog(1) or
328                   git-blame(1))
329
330               %ae
331                   author email
332
333               %aE
334                   author email (respecting .mailmap, see git-shortlog(1) or
335                   git-blame(1))
336
337               %al
338                   author email local-part (the part before the @ sign)
339
340               %aL
341                   author local-part (see %al) respecting .mailmap, see git-
342                   shortlog(1) or git-blame(1))
343
344               %ad
345                   author date (format respects --date= option)
346
347               %aD
348                   author date, RFC2822 style
349
350               %ar
351                   author date, relative
352
353               %at
354                   author date, UNIX timestamp
355
356               %ai
357                   author date, ISO 8601-like format
358
359               %aI
360                   author date, strict ISO 8601 format
361
362               %as
363                   author date, short format (YYYY-MM-DD)
364
365               %cn
366                   committer name
367
368               %cN
369                   committer name (respecting .mailmap, see git-shortlog(1) or
370                   git-blame(1))
371
372               %ce
373                   committer email
374
375               %cE
376                   committer email (respecting .mailmap, see git-shortlog(1)
377                   or git-blame(1))
378
379               %cl
380                   committer email local-part (the part before the @ sign)
381
382               %cL
383                   committer local-part (see %cl) respecting .mailmap, see
384                   git-shortlog(1) or git-blame(1))
385
386               %cd
387                   committer date (format respects --date= option)
388
389               %cD
390                   committer date, RFC2822 style
391
392               %cr
393                   committer date, relative
394
395               %ct
396                   committer date, UNIX timestamp
397
398               %ci
399                   committer date, ISO 8601-like format
400
401               %cI
402                   committer date, strict ISO 8601 format
403
404               %cs
405                   committer date, short format (YYYY-MM-DD)
406
407               %d
408                   ref names, like the --decorate option of git-log(1)
409
410               %D
411                   ref names without the " (", ")" wrapping.
412
413               %S
414                   ref name given on the command line by which the commit was
415                   reached (like git log --source), only works with git log
416
417               %e
418                   encoding
419
420               %s
421                   subject
422
423               %f
424                   sanitized subject line, suitable for a filename
425
426               %b
427                   body
428
429               %B
430                   raw body (unwrapped subject and body)
431
432               %N
433                   commit notes
434
435               %GG
436                   raw verification message from GPG for a signed commit
437
438               %G?
439                   show "G" for a good (valid) signature, "B" for a bad
440                   signature, "U" for a good signature with unknown validity,
441                   "X" for a good signature that has expired, "Y" for a good
442                   signature made by an expired key, "R" for a good signature
443                   made by a revoked key, "E" if the signature cannot be
444                   checked (e.g. missing key) and "N" for no signature
445
446               %GS
447                   show the name of the signer for a signed commit
448
449               %GK
450                   show the key used to sign a signed commit
451
452               %GF
453                   show the fingerprint of the key used to sign a signed
454                   commit
455
456               %GP
457                   show the fingerprint of the primary key whose subkey was
458                   used to sign a signed commit
459
460               %GT
461                   show the trust level for the key used to sign a signed
462                   commit
463
464               %gD
465                   reflog selector, e.g., refs/stash@{1} or refs/stash@{2
466                   minutes ago}; the format follows the rules described for
467                   the -g option. The portion before the @ is the refname as
468                   given on the command line (so git log -g refs/heads/master
469                   would yield refs/heads/master@{0}).
470
471               %gd
472                   shortened reflog selector; same as %gD, but the refname
473                   portion is shortened for human readability (so
474                   refs/heads/master becomes just master).
475
476               %gn
477                   reflog identity name
478
479               %gN
480                   reflog identity name (respecting .mailmap, see git-
481                   shortlog(1) or git-blame(1))
482
483               %ge
484                   reflog identity email
485
486               %gE
487                   reflog identity email (respecting .mailmap, see git-
488                   shortlog(1) or git-blame(1))
489
490               %gs
491                   reflog subject
492
493               %(trailers[:options])
494                   display the trailers of the body as interpreted by git-
495                   interpret-trailers(1). The trailers string may be followed
496                   by a colon and zero or more comma-separated options. If any
497                   option is provided multiple times the last occurance wins.
498
499                   The boolean options accept an optional value [=<BOOL>]. The
500                   values true, false, on, off etc. are all accepted. See the
501                   "boolean" sub-section in "EXAMPLES" in git-config(1). If a
502                   boolean option is given with no value, it’s enabled.
503
504key=<K>: only show trailers with specified key.
505                       Matching is done case-insensitively and trailing colon
506                       is optional. If option is given multiple times trailer
507                       lines matching any of the keys are shown. This option
508                       automatically enables the only option so that
509                       non-trailer lines in the trailer block are hidden. If
510                       that is not desired it can be disabled with only=false.
511                       E.g., %(trailers:key=Reviewed-by) shows trailer lines
512                       with key Reviewed-by.
513
514only[=<BOOL>]: select whether non-trailer lines from
515                       the trailer block should be included.
516
517separator=<SEP>: specify a separator inserted between
518                       trailer lines. When this option is not given each
519                       trailer line is terminated with a line feed character.
520                       The string SEP may contain the literal formatting codes
521                       described above. To use comma as separator one must use
522                       %x2C as it would otherwise be parsed as next option.
523                       E.g., %(trailers:key=Ticket,separator=%x2C ) shows all
524                       trailer lines whose key is "Ticket" separated by a
525                       comma and a space.
526
527unfold[=<BOOL>]: make it behave as if
528                       interpret-trailer’s --unfold option was given. E.g.,
529                       %(trailers:only,unfold=true) unfolds and shows all
530                       trailer lines.
531
532keyonly[=<BOOL>]: only show the key part of the
533                       trailer.
534
535valueonly[=<BOOL>]: only show the value part of the
536                       trailer.
537
538key_value_separator=<SEP>: specify a separator inserted
539                       between trailer lines. When this option is not given
540                       each trailer key-value pair is separated by ": ".
541                       Otherwise it shares the same semantics as
542                       separator=<SEP> above.
543
544           Note
545           Some placeholders may depend on other options given to the revision
546           traversal engine. For example, the %g* reflog options will insert
547           an empty string unless we are traversing reflog entries (e.g., by
548           git log -g). The %d and %D placeholders will use the "short"
549           decoration format if --decorate was not already provided on the
550           command line.
551
552       If you add a + (plus sign) after % of a placeholder, a line-feed is
553       inserted immediately before the expansion if and only if the
554       placeholder expands to a non-empty string.
555
556       If you add a - (minus sign) after % of a placeholder, all consecutive
557       line-feeds immediately preceding the expansion are deleted if and only
558       if the placeholder expands to an empty string.
559
560       If you add a ` ` (space) after % of a placeholder, a space is inserted
561       immediately before the expansion if and only if the placeholder expands
562       to a non-empty string.
563
564tformat:
565
566           The tformat: format works exactly like format:, except that it
567           provides "terminator" semantics instead of "separator" semantics.
568           In other words, each commit has the message terminator character
569           (usually a newline) appended, rather than a separator placed
570           between entries. This means that the final entry of a single-line
571           format will be properly terminated with a new line, just as the
572           "oneline" format does. For example:
573
574               $ git log -2 --pretty=format:%h 4da45bef \
575                 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
576               4da45be
577               7134973 -- NO NEWLINE
578
579               $ git log -2 --pretty=tformat:%h 4da45bef \
580                 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
581               4da45be
582               7134973
583
584           In addition, any unrecognized string that has a % in it is
585           interpreted as if it has tformat: in front of it. For example,
586           these two are equivalent:
587
588               $ git log -2 --pretty=tformat:%h 4da45bef
589               $ git log -2 --pretty=%h 4da45bef
590

DIFF FORMATTING

592       The options below can be used to change the way git show generates diff
593       output.
594
595       -p, -u, --patch
596           Generate patch (see section on generating patches).
597
598       -s, --no-patch
599           Suppress diff output. Useful for commands like git show that show
600           the patch by default, or to cancel the effect of --patch.
601
602       --diff-merges=(off|none|first-parent|1|separate|m|combined|c|dense-combined|cc),
603       --no-diff-merges
604           Specify diff format to be used for merge commits. Default is
605           `dense-combined` unless --first-parent is in use, in which case
606           first-parent is the default.
607
608           --diff-merges=(off|none), --no-diff-merges
609               Disable output of diffs for merge commits. Useful to override
610               implied value.
611
612           --diff-merges=first-parent, --diff-merges=1
613               This option makes merge commits show the full diff with respect
614               to the first parent only.
615
616           --diff-merges=separate, --diff-merges=m, -m
617               This makes merge commits show the full diff with respect to
618               each of the parents. Separate log entry and diff is generated
619               for each parent.  -m doesn’t produce any output without -p.
620
621           --diff-merges=combined, --diff-merges=c, -c
622               With this option, diff output for a merge commit shows the
623               differences from each of the parents to the merge result
624               simultaneously instead of showing pairwise diff between a
625               parent and the result one at a time. Furthermore, it lists only
626               files which were modified from all parents.  -c implies -p.
627
628           --diff-merges=dense-combined, --diff-merges=cc, --cc
629               With this option the output produced by --diff-merges=combined
630               is further compressed by omitting uninteresting hunks whose
631               contents in the parents have only two variants and the merge
632               result picks one of them without modification.  --cc implies
633               -p.
634
635       --combined-all-paths
636           This flag causes combined diffs (used for merge commits) to list
637           the name of the file from all parents. It thus only has effect when
638           --diff-merges=[dense-]combined is in use, and is likely only useful
639           if filename changes are detected (i.e. when either rename or copy
640           detection have been requested).
641
642       -U<n>, --unified=<n>
643           Generate diffs with <n> lines of context instead of the usual
644           three. Implies --patch.
645
646       --output=<file>
647           Output to a specific file instead of stdout.
648
649       --output-indicator-new=<char>, --output-indicator-old=<char>,
650       --output-indicator-context=<char>
651           Specify the character used to indicate new, old or context lines in
652           the generated patch. Normally they are +, - and ' ' respectively.
653
654       --raw
655           For each commit, show a summary of changes using the raw diff
656           format. See the "RAW OUTPUT FORMAT" section of git-diff(1). This is
657           different from showing the log itself in raw format, which you can
658           achieve with --format=raw.
659
660       --patch-with-raw
661           Synonym for -p --raw.
662
663       -t
664           Show the tree objects in the diff output.
665
666       --indent-heuristic
667           Enable the heuristic that shifts diff hunk boundaries to make
668           patches easier to read. This is the default.
669
670       --no-indent-heuristic
671           Disable the indent heuristic.
672
673       --minimal
674           Spend extra time to make sure the smallest possible diff is
675           produced.
676
677       --patience
678           Generate a diff using the "patience diff" algorithm.
679
680       --histogram
681           Generate a diff using the "histogram diff" algorithm.
682
683       --anchored=<text>
684           Generate a diff using the "anchored diff" algorithm.
685
686           This option may be specified more than once.
687
688           If a line exists in both the source and destination, exists only
689           once, and starts with this text, this algorithm attempts to prevent
690           it from appearing as a deletion or addition in the output. It uses
691           the "patience diff" algorithm internally.
692
693       --diff-algorithm={patience|minimal|histogram|myers}
694           Choose a diff algorithm. The variants are as follows:
695
696           default, myers
697               The basic greedy diff algorithm. Currently, this is the
698               default.
699
700           minimal
701               Spend extra time to make sure the smallest possible diff is
702               produced.
703
704           patience
705               Use "patience diff" algorithm when generating patches.
706
707           histogram
708               This algorithm extends the patience algorithm to "support
709               low-occurrence common elements".
710
711           For instance, if you configured the diff.algorithm variable to a
712           non-default value and want to use the default one, then you have to
713           use --diff-algorithm=default option.
714
715       --stat[=<width>[,<name-width>[,<count>]]]
716           Generate a diffstat. By default, as much space as necessary will be
717           used for the filename part, and the rest for the graph part.
718           Maximum width defaults to terminal width, or 80 columns if not
719           connected to a terminal, and can be overridden by <width>. The
720           width of the filename part can be limited by giving another width
721           <name-width> after a comma. The width of the graph part can be
722           limited by using --stat-graph-width=<width> (affects all commands
723           generating a stat graph) or by setting diff.statGraphWidth=<width>
724           (does not affect git format-patch). By giving a third parameter
725           <count>, you can limit the output to the first <count> lines,
726           followed by ...  if there are more.
727
728           These parameters can also be set individually with
729           --stat-width=<width>, --stat-name-width=<name-width> and
730           --stat-count=<count>.
731
732       --compact-summary
733           Output a condensed summary of extended header information such as
734           file creations or deletions ("new" or "gone", optionally "+l" if
735           it’s a symlink) and mode changes ("+x" or "-x" for adding or
736           removing executable bit respectively) in diffstat. The information
737           is put between the filename part and the graph part. Implies
738           --stat.
739
740       --numstat
741           Similar to --stat, but shows number of added and deleted lines in
742           decimal notation and pathname without abbreviation, to make it more
743           machine friendly. For binary files, outputs two - instead of saying
744           0 0.
745
746       --shortstat
747           Output only the last line of the --stat format containing total
748           number of modified files, as well as number of added and deleted
749           lines.
750
751       -X[<param1,param2,...>], --dirstat[=<param1,param2,...>]
752           Output the distribution of relative amount of changes for each
753           sub-directory. The behavior of --dirstat can be customized by
754           passing it a comma separated list of parameters. The defaults are
755           controlled by the diff.dirstat configuration variable (see git-
756           config(1)). The following parameters are available:
757
758           changes
759               Compute the dirstat numbers by counting the lines that have
760               been removed from the source, or added to the destination. This
761               ignores the amount of pure code movements within a file. In
762               other words, rearranging lines in a file is not counted as much
763               as other changes. This is the default behavior when no
764               parameter is given.
765
766           lines
767               Compute the dirstat numbers by doing the regular line-based
768               diff analysis, and summing the removed/added line counts. (For
769               binary files, count 64-byte chunks instead, since binary files
770               have no natural concept of lines). This is a more expensive
771               --dirstat behavior than the changes behavior, but it does count
772               rearranged lines within a file as much as other changes. The
773               resulting output is consistent with what you get from the other
774               --*stat options.
775
776           files
777               Compute the dirstat numbers by counting the number of files
778               changed. Each changed file counts equally in the dirstat
779               analysis. This is the computationally cheapest --dirstat
780               behavior, since it does not have to look at the file contents
781               at all.
782
783           cumulative
784               Count changes in a child directory for the parent directory as
785               well. Note that when using cumulative, the sum of the
786               percentages reported may exceed 100%. The default
787               (non-cumulative) behavior can be specified with the
788               noncumulative parameter.
789
790           <limit>
791               An integer parameter specifies a cut-off percent (3% by
792               default). Directories contributing less than this percentage of
793               the changes are not shown in the output.
794
795           Example: The following will count changed files, while ignoring
796           directories with less than 10% of the total amount of changed
797           files, and accumulating child directory counts in the parent
798           directories: --dirstat=files,10,cumulative.
799
800       --cumulative
801           Synonym for --dirstat=cumulative
802
803       --dirstat-by-file[=<param1,param2>...]
804           Synonym for --dirstat=files,param1,param2...
805
806       --summary
807           Output a condensed summary of extended header information such as
808           creations, renames and mode changes.
809
810       --patch-with-stat
811           Synonym for -p --stat.
812
813       -z
814           Separate the commits with NULs instead of with new newlines.
815
816           Also, when --raw or --numstat has been given, do not munge
817           pathnames and use NULs as output field terminators.
818
819           Without this option, pathnames with "unusual" characters are quoted
820           as explained for the configuration variable core.quotePath (see
821           git-config(1)).
822
823       --name-only
824           Show only names of changed files.
825
826       --name-status
827           Show only names and status of changed files. See the description of
828           the --diff-filter option on what the status letters mean.
829
830       --submodule[=<format>]
831           Specify how differences in submodules are shown. When specifying
832           --submodule=short the short format is used. This format just shows
833           the names of the commits at the beginning and end of the range.
834           When --submodule or --submodule=log is specified, the log format is
835           used. This format lists the commits in the range like git-
836           submodule(1) summary does. When --submodule=diff is specified, the
837           diff format is used. This format shows an inline diff of the
838           changes in the submodule contents between the commit range.
839           Defaults to diff.submodule or the short format if the config option
840           is unset.
841
842       --color[=<when>]
843           Show colored diff.  --color (i.e. without =<when>) is the same as
844           --color=always.  <when> can be one of always, never, or auto.
845
846       --no-color
847           Turn off colored diff. It is the same as --color=never.
848
849       --color-moved[=<mode>]
850           Moved lines of code are colored differently. The <mode> defaults to
851           no if the option is not given and to zebra if the option with no
852           mode is given. The mode must be one of:
853
854           no
855               Moved lines are not highlighted.
856
857           default
858               Is a synonym for zebra. This may change to a more sensible mode
859               in the future.
860
861           plain
862               Any line that is added in one location and was removed in
863               another location will be colored with color.diff.newMoved.
864               Similarly color.diff.oldMoved will be used for removed lines
865               that are added somewhere else in the diff. This mode picks up
866               any moved line, but it is not very useful in a review to
867               determine if a block of code was moved without permutation.
868
869           blocks
870               Blocks of moved text of at least 20 alphanumeric characters are
871               detected greedily. The detected blocks are painted using either
872               the color.diff.{old,new}Moved color. Adjacent blocks cannot be
873               told apart.
874
875           zebra
876               Blocks of moved text are detected as in blocks mode. The blocks
877               are painted using either the color.diff.{old,new}Moved color or
878               color.diff.{old,new}MovedAlternative. The change between the
879               two colors indicates that a new block was detected.
880
881           dimmed-zebra
882               Similar to zebra, but additional dimming of uninteresting parts
883               of moved code is performed. The bordering lines of two adjacent
884               blocks are considered interesting, the rest is uninteresting.
885               dimmed_zebra is a deprecated synonym.
886
887       --no-color-moved
888           Turn off move detection. This can be used to override configuration
889           settings. It is the same as --color-moved=no.
890
891       --color-moved-ws=<modes>
892           This configures how whitespace is ignored when performing the move
893           detection for --color-moved. These modes can be given as a comma
894           separated list:
895
896           no
897               Do not ignore whitespace when performing move detection.
898
899           ignore-space-at-eol
900               Ignore changes in whitespace at EOL.
901
902           ignore-space-change
903               Ignore changes in amount of whitespace. This ignores whitespace
904               at line end, and considers all other sequences of one or more
905               whitespace characters to be equivalent.
906
907           ignore-all-space
908               Ignore whitespace when comparing lines. This ignores
909               differences even if one line has whitespace where the other
910               line has none.
911
912           allow-indentation-change
913               Initially ignore any whitespace in the move detection, then
914               group the moved code blocks only into a block if the change in
915               whitespace is the same per line. This is incompatible with the
916               other modes.
917
918       --no-color-moved-ws
919           Do not ignore whitespace when performing move detection. This can
920           be used to override configuration settings. It is the same as
921           --color-moved-ws=no.
922
923       --word-diff[=<mode>]
924           Show a word diff, using the <mode> to delimit changed words. By
925           default, words are delimited by whitespace; see --word-diff-regex
926           below. The <mode> defaults to plain, and must be one of:
927
928           color
929               Highlight changed words using only colors. Implies --color.
930
931           plain
932               Show words as [-removed-] and {+added+}. Makes no attempts to
933               escape the delimiters if they appear in the input, so the
934               output may be ambiguous.
935
936           porcelain
937               Use a special line-based format intended for script
938               consumption. Added/removed/unchanged runs are printed in the
939               usual unified diff format, starting with a +/-/` ` character at
940               the beginning of the line and extending to the end of the line.
941               Newlines in the input are represented by a tilde ~ on a line of
942               its own.
943
944           none
945               Disable word diff again.
946
947           Note that despite the name of the first mode, color is used to
948           highlight the changed parts in all modes if enabled.
949
950       --word-diff-regex=<regex>
951           Use <regex> to decide what a word is, instead of considering runs
952           of non-whitespace to be a word. Also implies --word-diff unless it
953           was already enabled.
954
955           Every non-overlapping match of the <regex> is considered a word.
956           Anything between these matches is considered whitespace and
957           ignored(!) for the purposes of finding differences. You may want to
958           append |[^[:space:]] to your regular expression to make sure that
959           it matches all non-whitespace characters. A match that contains a
960           newline is silently truncated(!) at the newline.
961
962           For example, --word-diff-regex=.  will treat each character as a
963           word and, correspondingly, show differences character by character.
964
965           The regex can also be set via a diff driver or configuration
966           option, see gitattributes(5) or git-config(1). Giving it explicitly
967           overrides any diff driver or configuration setting. Diff drivers
968           override configuration settings.
969
970       --color-words[=<regex>]
971           Equivalent to --word-diff=color plus (if a regex was specified)
972           --word-diff-regex=<regex>.
973
974       --no-renames
975           Turn off rename detection, even when the configuration file gives
976           the default to do so.
977
978       --[no-]rename-empty
979           Whether to use empty blobs as rename source.
980
981       --check
982           Warn if changes introduce conflict markers or whitespace errors.
983           What are considered whitespace errors is controlled by
984           core.whitespace configuration. By default, trailing whitespaces
985           (including lines that consist solely of whitespaces) and a space
986           character that is immediately followed by a tab character inside
987           the initial indent of the line are considered whitespace errors.
988           Exits with non-zero status if problems are found. Not compatible
989           with --exit-code.
990
991       --ws-error-highlight=<kind>
992           Highlight whitespace errors in the context, old or new lines of the
993           diff. Multiple values are separated by comma, none resets previous
994           values, default reset the list to new and all is a shorthand for
995           old,new,context. When this option is not given, and the
996           configuration variable diff.wsErrorHighlight is not set, only
997           whitespace errors in new lines are highlighted. The whitespace
998           errors are colored with color.diff.whitespace.
999
1000       --full-index
1001           Instead of the first handful of characters, show the full pre- and
1002           post-image blob object names on the "index" line when generating
1003           patch format output.
1004
1005       --binary
1006           In addition to --full-index, output a binary diff that can be
1007           applied with git-apply. Implies --patch.
1008
1009       --abbrev[=<n>]
1010           Instead of showing the full 40-byte hexadecimal object name in
1011           diff-raw format output and diff-tree header lines, show the
1012           shortest prefix that is at least <n> hexdigits long that uniquely
1013           refers the object. In diff-patch output format, --full-index takes
1014           higher precedence, i.e. if --full-index is specified, full blob
1015           names will be shown regardless of --abbrev. Non default number of
1016           digits can be specified with --abbrev=<n>.
1017
1018       -B[<n>][/<m>], --break-rewrites[=[<n>][/<m>]]
1019           Break complete rewrite changes into pairs of delete and create.
1020           This serves two purposes:
1021
1022           It affects the way a change that amounts to a total rewrite of a
1023           file not as a series of deletion and insertion mixed together with
1024           a very few lines that happen to match textually as the context, but
1025           as a single deletion of everything old followed by a single
1026           insertion of everything new, and the number m controls this aspect
1027           of the -B option (defaults to 60%).  -B/70% specifies that less
1028           than 30% of the original should remain in the result for Git to
1029           consider it a total rewrite (i.e. otherwise the resulting patch
1030           will be a series of deletion and insertion mixed together with
1031           context lines).
1032
1033           When used with -M, a totally-rewritten file is also considered as
1034           the source of a rename (usually -M only considers a file that
1035           disappeared as the source of a rename), and the number n controls
1036           this aspect of the -B option (defaults to 50%).  -B20% specifies
1037           that a change with addition and deletion compared to 20% or more of
1038           the file’s size are eligible for being picked up as a possible
1039           source of a rename to another file.
1040
1041       -M[<n>], --find-renames[=<n>]
1042           If generating diffs, detect and report renames for each commit. For
1043           following files across renames while traversing history, see
1044           --follow. If n is specified, it is a threshold on the similarity
1045           index (i.e. amount of addition/deletions compared to the file’s
1046           size). For example, -M90% means Git should consider a delete/add
1047           pair to be a rename if more than 90% of the file hasn’t changed.
1048           Without a % sign, the number is to be read as a fraction, with a
1049           decimal point before it. I.e., -M5 becomes 0.5, and is thus the
1050           same as -M50%. Similarly, -M05 is the same as -M5%. To limit
1051           detection to exact renames, use -M100%. The default similarity
1052           index is 50%.
1053
1054       -C[<n>], --find-copies[=<n>]
1055           Detect copies as well as renames. See also --find-copies-harder. If
1056           n is specified, it has the same meaning as for -M<n>.
1057
1058       --find-copies-harder
1059           For performance reasons, by default, -C option finds copies only if
1060           the original file of the copy was modified in the same changeset.
1061           This flag makes the command inspect unmodified files as candidates
1062           for the source of copy. This is a very expensive operation for
1063           large projects, so use it with caution. Giving more than one -C
1064           option has the same effect.
1065
1066       -D, --irreversible-delete
1067           Omit the preimage for deletes, i.e. print only the header but not
1068           the diff between the preimage and /dev/null. The resulting patch is
1069           not meant to be applied with patch or git apply; this is solely for
1070           people who want to just concentrate on reviewing the text after the
1071           change. In addition, the output obviously lacks enough information
1072           to apply such a patch in reverse, even manually, hence the name of
1073           the option.
1074
1075           When used together with -B, omit also the preimage in the deletion
1076           part of a delete/create pair.
1077
1078       -l<num>
1079           The -M and -C options require O(n^2) processing time where n is the
1080           number of potential rename/copy targets. This option prevents
1081           rename/copy detection from running if the number of rename/copy
1082           targets exceeds the specified number.
1083
1084       --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]
1085           Select only files that are Added (A), Copied (C), Deleted (D),
1086           Modified (M), Renamed (R), have their type (i.e. regular file,
1087           symlink, submodule, ...) changed (T), are Unmerged (U), are Unknown
1088           (X), or have had their pairing Broken (B). Any combination of the
1089           filter characters (including none) can be used. When *
1090           (All-or-none) is added to the combination, all paths are selected
1091           if there is any file that matches other criteria in the comparison;
1092           if there is no file that matches other criteria, nothing is
1093           selected.
1094
1095           Also, these upper-case letters can be downcased to exclude. E.g.
1096           --diff-filter=ad excludes added and deleted paths.
1097
1098           Note that not all diffs can feature all types. For instance, diffs
1099           from the index to the working tree can never have Added entries
1100           (because the set of paths included in the diff is limited by what
1101           is in the index). Similarly, copied and renamed entries cannot
1102           appear if detection for those types is disabled.
1103
1104       -S<string>
1105           Look for differences that change the number of occurrences of the
1106           specified string (i.e. addition/deletion) in a file. Intended for
1107           the scripter’s use.
1108
1109           It is useful when you’re looking for an exact block of code (like a
1110           struct), and want to know the history of that block since it first
1111           came into being: use the feature iteratively to feed the
1112           interesting block in the preimage back into -S, and keep going
1113           until you get the very first version of the block.
1114
1115           Binary files are searched as well.
1116
1117       -G<regex>
1118           Look for differences whose patch text contains added/removed lines
1119           that match <regex>.
1120
1121           To illustrate the difference between -S<regex> --pickaxe-regex and
1122           -G<regex>, consider a commit with the following diff in the same
1123           file:
1124
1125               +    return frotz(nitfol, two->ptr, 1, 0);
1126               ...
1127               -    hit = frotz(nitfol, mf2.ptr, 1, 0);
1128
1129           While git log -G"frotz\(nitfol" will show this commit, git log
1130           -S"frotz\(nitfol" --pickaxe-regex will not (because the number of
1131           occurrences of that string did not change).
1132
1133           Unless --text is supplied patches of binary files without a
1134           textconv filter will be ignored.
1135
1136           See the pickaxe entry in gitdiffcore(7) for more information.
1137
1138       --find-object=<object-id>
1139           Look for differences that change the number of occurrences of the
1140           specified object. Similar to -S, just the argument is different in
1141           that it doesn’t search for a specific string but for a specific
1142           object id.
1143
1144           The object can be a blob or a submodule commit. It implies the -t
1145           option in git-log to also find trees.
1146
1147       --pickaxe-all
1148           When -S or -G finds a change, show all the changes in that
1149           changeset, not just the files that contain the change in <string>.
1150
1151       --pickaxe-regex
1152           Treat the <string> given to -S as an extended POSIX regular
1153           expression to match.
1154
1155       -O<orderfile>
1156           Control the order in which files appear in the output. This
1157           overrides the diff.orderFile configuration variable (see git-
1158           config(1)). To cancel diff.orderFile, use -O/dev/null.
1159
1160           The output order is determined by the order of glob patterns in
1161           <orderfile>. All files with pathnames that match the first pattern
1162           are output first, all files with pathnames that match the second
1163           pattern (but not the first) are output next, and so on. All files
1164           with pathnames that do not match any pattern are output last, as if
1165           there was an implicit match-all pattern at the end of the file. If
1166           multiple pathnames have the same rank (they match the same pattern
1167           but no earlier patterns), their output order relative to each other
1168           is the normal order.
1169
1170           <orderfile> is parsed as follows:
1171
1172           •   Blank lines are ignored, so they can be used as separators for
1173               readability.
1174
1175           •   Lines starting with a hash ("#") are ignored, so they can be
1176               used for comments. Add a backslash ("\") to the beginning of
1177               the pattern if it starts with a hash.
1178
1179           •   Each other line contains a single pattern.
1180
1181           Patterns have the same syntax and semantics as patterns used for
1182           fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
1183           matches a pattern if removing any number of the final pathname
1184           components matches the pattern. For example, the pattern "foo*bar"
1185           matches "fooasdfbar" and "foo/bar/baz/asdf" but not "foobarx".
1186
1187       --skip-to=<file>, --rotate-to=<file>
1188           Discard the files before the named <file> from the output (i.e.
1189           skip to), or move them to the end of the output (i.e.  rotate to).
1190           These were invented primarily for use of the git difftool command,
1191           and may not be very useful otherwise.
1192
1193       -R
1194           Swap two inputs; that is, show differences from index or on-disk
1195           file to tree contents.
1196
1197       --relative[=<path>], --no-relative
1198           When run from a subdirectory of the project, it can be told to
1199           exclude changes outside the directory and show pathnames relative
1200           to it with this option. When you are not in a subdirectory (e.g. in
1201           a bare repository), you can name which subdirectory to make the
1202           output relative to by giving a <path> as an argument.
1203           --no-relative can be used to countermand both diff.relative config
1204           option and previous --relative.
1205
1206       -a, --text
1207           Treat all files as text.
1208
1209       --ignore-cr-at-eol
1210           Ignore carriage-return at the end of line when doing a comparison.
1211
1212       --ignore-space-at-eol
1213           Ignore changes in whitespace at EOL.
1214
1215       -b, --ignore-space-change
1216           Ignore changes in amount of whitespace. This ignores whitespace at
1217           line end, and considers all other sequences of one or more
1218           whitespace characters to be equivalent.
1219
1220       -w, --ignore-all-space
1221           Ignore whitespace when comparing lines. This ignores differences
1222           even if one line has whitespace where the other line has none.
1223
1224       --ignore-blank-lines
1225           Ignore changes whose lines are all blank.
1226
1227       -I<regex>, --ignore-matching-lines=<regex>
1228           Ignore changes whose all lines match <regex>. This option may be
1229           specified more than once.
1230
1231       --inter-hunk-context=<lines>
1232           Show the context between diff hunks, up to the specified number of
1233           lines, thereby fusing hunks that are close to each other. Defaults
1234           to diff.interHunkContext or 0 if the config option is unset.
1235
1236       -W, --function-context
1237           Show whole function as context lines for each change. The function
1238           names are determined in the same way as git diff works out patch
1239           hunk headers (see Defining a custom hunk-header in
1240           gitattributes(5)).
1241
1242       --ext-diff
1243           Allow an external diff helper to be executed. If you set an
1244           external diff driver with gitattributes(5), you need to use this
1245           option with git-log(1) and friends.
1246
1247       --no-ext-diff
1248           Disallow external diff drivers.
1249
1250       --textconv, --no-textconv
1251           Allow (or disallow) external text conversion filters to be run when
1252           comparing binary files. See gitattributes(5) for details. Because
1253           textconv filters are typically a one-way conversion, the resulting
1254           diff is suitable for human consumption, but cannot be applied. For
1255           this reason, textconv filters are enabled by default only for git-
1256           diff(1) and git-log(1), but not for git-format-patch(1) or diff
1257           plumbing commands.
1258
1259       --ignore-submodules[=<when>]
1260           Ignore changes to submodules in the diff generation. <when> can be
1261           either "none", "untracked", "dirty" or "all", which is the default.
1262           Using "none" will consider the submodule modified when it either
1263           contains untracked or modified files or its HEAD differs from the
1264           commit recorded in the superproject and can be used to override any
1265           settings of the ignore option in git-config(1) or gitmodules(5).
1266           When "untracked" is used submodules are not considered dirty when
1267           they only contain untracked content (but they are still scanned for
1268           modified content). Using "dirty" ignores all changes to the work
1269           tree of submodules, only changes to the commits stored in the
1270           superproject are shown (this was the behavior until 1.7.0). Using
1271           "all" hides all changes to submodules.
1272
1273       --src-prefix=<prefix>
1274           Show the given source prefix instead of "a/".
1275
1276       --dst-prefix=<prefix>
1277           Show the given destination prefix instead of "b/".
1278
1279       --no-prefix
1280           Do not show any source or destination prefix.
1281
1282       --line-prefix=<prefix>
1283           Prepend an additional prefix to every line of output.
1284
1285       --ita-invisible-in-index
1286           By default entries added by "git add -N" appear as an existing
1287           empty file in "git diff" and a new file in "git diff --cached".
1288           This option makes the entry appear as a new file in "git diff" and
1289           non-existent in "git diff --cached". This option could be reverted
1290           with --ita-visible-in-index. Both options are experimental and
1291           could be removed in future.
1292
1293       For more detailed explanation on these common options, see also
1294       gitdiffcore(7).
1295

GENERATING PATCH TEXT WITH -P

1297       Running git-diff(1), git-log(1), git-show(1), git-diff-index(1), git-
1298       diff-tree(1), or git-diff-files(1) with the -p option produces patch
1299       text. You can customize the creation of patch text via the
1300       GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables (see
1301       git(1)).
1302
1303       What the -p option produces is slightly different from the traditional
1304       diff format:
1305
1306        1. It is preceded with a "git diff" header that looks like this:
1307
1308               diff --git a/file1 b/file2
1309
1310           The a/ and b/ filenames are the same unless rename/copy is
1311           involved. Especially, even for a creation or a deletion, /dev/null
1312           is not used in place of the a/ or b/ filenames.
1313
1314           When rename/copy is involved, file1 and file2 show the name of the
1315           source file of the rename/copy and the name of the file that
1316           rename/copy produces, respectively.
1317
1318        2. It is followed by one or more extended header lines:
1319
1320               old mode <mode>
1321               new mode <mode>
1322               deleted file mode <mode>
1323               new file mode <mode>
1324               copy from <path>
1325               copy to <path>
1326               rename from <path>
1327               rename to <path>
1328               similarity index <number>
1329               dissimilarity index <number>
1330               index <hash>..<hash> <mode>
1331
1332           File modes are printed as 6-digit octal numbers including the file
1333           type and file permission bits.
1334
1335           Path names in extended headers do not include the a/ and b/
1336           prefixes.
1337
1338           The similarity index is the percentage of unchanged lines, and the
1339           dissimilarity index is the percentage of changed lines. It is a
1340           rounded down integer, followed by a percent sign. The similarity
1341           index value of 100% is thus reserved for two equal files, while
1342           100% dissimilarity means that no line from the old file made it
1343           into the new one.
1344
1345           The index line includes the blob object names before and after the
1346           change. The <mode> is included if the file mode does not change;
1347           otherwise, separate lines indicate the old and the new mode.
1348
1349        3. Pathnames with "unusual" characters are quoted as explained for the
1350           configuration variable core.quotePath (see git-config(1)).
1351
1352        4. All the file1 files in the output refer to files before the commit,
1353           and all the file2 files refer to files after the commit. It is
1354           incorrect to apply each change to each file sequentially. For
1355           example, this patch will swap a and b:
1356
1357               diff --git a/a b/b
1358               rename from a
1359               rename to b
1360               diff --git a/b b/a
1361               rename from b
1362               rename to a
1363

COMBINED DIFF FORMAT

1365       Any diff-generating command can take the -c or --cc option to produce a
1366       combined diff when showing a merge. This is the default format when
1367       showing merges with git-diff(1) or git-show(1). Note also that you can
1368       give suitable --diff-merges option to any of these commands to force
1369       generation of diffs in specific format.
1370
1371       A "combined diff" format looks like this:
1372
1373           diff --combined describe.c
1374           index fabadb8,cc95eb0..4866510
1375           --- a/describe.c
1376           +++ b/describe.c
1377           @@@ -98,20 -98,12 +98,20 @@@
1378                   return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
1379             }
1380
1381           - static void describe(char *arg)
1382            -static void describe(struct commit *cmit, int last_one)
1383           ++static void describe(char *arg, int last_one)
1384             {
1385            +      unsigned char sha1[20];
1386            +      struct commit *cmit;
1387                   struct commit_list *list;
1388                   static int initialized = 0;
1389                   struct commit_name *n;
1390
1391            +      if (get_sha1(arg, sha1) < 0)
1392            +              usage(describe_usage);
1393            +      cmit = lookup_commit_reference(sha1);
1394            +      if (!cmit)
1395            +              usage(describe_usage);
1396            +
1397                   if (!initialized) {
1398                           initialized = 1;
1399                           for_each_ref(get_name);
1400
1401        1. It is preceded with a "git diff" header, that looks like this (when
1402           the -c option is used):
1403
1404               diff --combined file
1405
1406           or like this (when the --cc option is used):
1407
1408               diff --cc file
1409
1410        2. It is followed by one or more extended header lines (this example
1411           shows a merge with two parents):
1412
1413               index <hash>,<hash>..<hash>
1414               mode <mode>,<mode>..<mode>
1415               new file mode <mode>
1416               deleted file mode <mode>,<mode>
1417
1418           The mode <mode>,<mode>..<mode> line appears only if at least one of
1419           the <mode> is different from the rest. Extended headers with
1420           information about detected contents movement (renames and copying
1421           detection) are designed to work with diff of two <tree-ish> and are
1422           not used by combined diff format.
1423
1424        3. It is followed by two-line from-file/to-file header
1425
1426               --- a/file
1427               +++ b/file
1428
1429           Similar to two-line header for traditional unified diff format,
1430           /dev/null is used to signal created or deleted files.
1431
1432           However, if the --combined-all-paths option is provided, instead of
1433           a two-line from-file/to-file you get a N+1 line from-file/to-file
1434           header, where N is the number of parents in the merge commit
1435
1436               --- a/file
1437               --- a/file
1438               --- a/file
1439               +++ b/file
1440
1441           This extended format can be useful if rename or copy detection is
1442           active, to allow you to see the original name of the file in
1443           different parents.
1444
1445        4. Chunk header format is modified to prevent people from accidentally
1446           feeding it to patch -p1. Combined diff format was created for
1447           review of merge commit changes, and was not meant to be applied.
1448           The change is similar to the change in the extended index header:
1449
1450               @@@ <from-file-range> <from-file-range> <to-file-range> @@@
1451
1452           There are (number of parents + 1) @ characters in the chunk header
1453           for combined diff format.
1454
1455       Unlike the traditional unified diff format, which shows two files A and
1456       B with a single column that has - (minus — appears in A but removed in
1457       B), + (plus — missing in A but added to B), or " " (space — unchanged)
1458       prefix, this format compares two or more files file1, file2,... with
1459       one file X, and shows how X differs from each of fileN. One column for
1460       each of fileN is prepended to the output line to note how X’s line is
1461       different from it.
1462
1463       A - character in the column N means that the line appears in fileN but
1464       it does not appear in the result. A + character in the column N means
1465       that the line appears in the result, and fileN does not have that line
1466       (in other words, the line was added, from the point of view of that
1467       parent).
1468
1469       In the above example output, the function signature was changed from
1470       both files (hence two - removals from both file1 and file2, plus ++ to
1471       mean one line that was added does not appear in either file1 or file2).
1472       Also eight other lines are the same from file1 but do not appear in
1473       file2 (hence prefixed with +).
1474
1475       When shown by git diff-tree -c, it compares the parents of a merge
1476       commit with the merge result (i.e. file1..fileN are the parents). When
1477       shown by git diff-files -c, it compares the two unresolved merge
1478       parents with the working tree file (i.e. file1 is stage 2 aka "our
1479       version", file2 is stage 3 aka "their version").
1480

EXAMPLES

1482       git show v1.0.0
1483           Shows the tag v1.0.0, along with the object the tags points at.
1484
1485       git show v1.0.0^{tree}
1486           Shows the tree pointed to by the tag v1.0.0.
1487
1488       git show -s --format=%s v1.0.0^{commit}
1489           Shows the subject of the commit pointed to by the tag v1.0.0.
1490
1491       git show next~10:Documentation/README
1492           Shows the contents of the file Documentation/README as they were
1493           current in the 10th last commit of the branch next.
1494
1495       git show master:Makefile master:t/Makefile
1496           Concatenates the contents of said Makefiles in the head of the
1497           branch master.
1498

DISCUSSION

1500       Git is to some extent character encoding agnostic.
1501
1502       •   The contents of the blob objects are uninterpreted sequences of
1503           bytes. There is no encoding translation at the core level.
1504
1505       •   Path names are encoded in UTF-8 normalization form C. This applies
1506           to tree objects, the index file, ref names, as well as path names
1507           in command line arguments, environment variables and config files
1508           (.git/config (see git-config(1)), gitignore(5), gitattributes(5)
1509           and gitmodules(5)).
1510
1511           Note that Git at the core level treats path names simply as
1512           sequences of non-NUL bytes, there are no path name encoding
1513           conversions (except on Mac and Windows). Therefore, using non-ASCII
1514           path names will mostly work even on platforms and file systems that
1515           use legacy extended ASCII encodings. However, repositories created
1516           on such systems will not work properly on UTF-8-based systems (e.g.
1517           Linux, Mac, Windows) and vice versa. Additionally, many Git-based
1518           tools simply assume path names to be UTF-8 and will fail to display
1519           other encodings correctly.
1520
1521       •   Commit log messages are typically encoded in UTF-8, but other
1522           extended ASCII encodings are also supported. This includes
1523           ISO-8859-x, CP125x and many others, but not UTF-16/32, EBCDIC and
1524           CJK multi-byte encodings (GBK, Shift-JIS, Big5, EUC-x, CP9xx etc.).
1525
1526       Although we encourage that the commit log messages are encoded in
1527       UTF-8, both the core and Git Porcelain are designed not to force UTF-8
1528       on projects. If all participants of a particular project find it more
1529       convenient to use legacy encodings, Git does not forbid it. However,
1530       there are a few things to keep in mind.
1531
1532        1. git commit and git commit-tree issues a warning if the commit log
1533           message given to it does not look like a valid UTF-8 string, unless
1534           you explicitly say your project uses a legacy encoding. The way to
1535           say this is to have i18n.commitEncoding in .git/config file, like
1536           this:
1537
1538               [i18n]
1539                       commitEncoding = ISO-8859-1
1540
1541           Commit objects created with the above setting record the value of
1542           i18n.commitEncoding in its encoding header. This is to help other
1543           people who look at them later. Lack of this header implies that the
1544           commit log message is encoded in UTF-8.
1545
1546        2. git log, git show, git blame and friends look at the encoding
1547           header of a commit object, and try to re-code the log message into
1548           UTF-8 unless otherwise specified. You can specify the desired
1549           output encoding with i18n.logOutputEncoding in .git/config file,
1550           like this:
1551
1552               [i18n]
1553                       logOutputEncoding = ISO-8859-1
1554
1555           If you do not have this configuration variable, the value of
1556           i18n.commitEncoding is used instead.
1557
1558       Note that we deliberately chose not to re-code the commit log message
1559       when a commit is made to force UTF-8 at the commit object level,
1560       because re-coding to UTF-8 is not necessarily a reversible operation.
1561

GIT

1563       Part of the git(1) suite
1564
1565
1566
1567Git 2.31.1                        2021-03-26                       GIT-SHOW(1)
Impressum