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
11

DESCRIPTION

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

OPTIONS

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

PRETTY FORMATS

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

COMMON DIFF OPTIONS

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

GENERATING PATCH TEXT WITH -P

1188       Running git-diff(1), git-log(1), git-show(1), git-diff-index(1), git-
1189       diff-tree(1), or git-diff-files(1) with the -p option produces patch
1190       text. You can customize the creation of patch text via the
1191       GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.
1192
1193       What the -p option produces is slightly different from the traditional
1194       diff format:
1195
1196        1. It is preceded with a "git diff" header that looks like this:
1197
1198               diff --git a/file1 b/file2
1199
1200           The a/ and b/ filenames are the same unless rename/copy is
1201           involved. Especially, even for a creation or a deletion, /dev/null
1202           is not used in place of the a/ or b/ filenames.
1203
1204           When rename/copy is involved, file1 and file2 show the name of the
1205           source file of the rename/copy and the name of the file that
1206           rename/copy produces, respectively.
1207
1208        2. It is followed by one or more extended header lines:
1209
1210               old mode <mode>
1211               new mode <mode>
1212               deleted file mode <mode>
1213               new file mode <mode>
1214               copy from <path>
1215               copy to <path>
1216               rename from <path>
1217               rename to <path>
1218               similarity index <number>
1219               dissimilarity index <number>
1220               index <hash>..<hash> <mode>
1221
1222           File modes are printed as 6-digit octal numbers including the file
1223           type and file permission bits.
1224
1225           Path names in extended headers do not include the a/ and b/
1226           prefixes.
1227
1228           The similarity index is the percentage of unchanged lines, and the
1229           dissimilarity index is the percentage of changed lines. It is a
1230           rounded down integer, followed by a percent sign. The similarity
1231           index value of 100% is thus reserved for two equal files, while
1232           100% dissimilarity means that no line from the old file made it
1233           into the new one.
1234
1235           The index line includes the blob object names before and after the
1236           change. The <mode> is included if the file mode does not change;
1237           otherwise, separate lines indicate the old and the new mode.
1238
1239        3. Pathnames with "unusual" characters are quoted as explained for the
1240           configuration variable core.quotePath (see git-config(1)).
1241
1242        4. All the file1 files in the output refer to files before the commit,
1243           and all the file2 files refer to files after the commit. It is
1244           incorrect to apply each change to each file sequentially. For
1245           example, this patch will swap a and b:
1246
1247               diff --git a/a b/b
1248               rename from a
1249               rename to b
1250               diff --git a/b b/a
1251               rename from b
1252               rename to a
1253

COMBINED DIFF FORMAT

1255       Any diff-generating command can take the -c or --cc option to produce a
1256       combined diff when showing a merge. This is the default format when
1257       showing merges with git-diff(1) or git-show(1). Note also that you can
1258       give the -m option to any of these commands to force generation of
1259       diffs with individual parents of a merge.
1260
1261       A "combined diff" format looks like this:
1262
1263           diff --combined describe.c
1264           index fabadb8,cc95eb0..4866510
1265           --- a/describe.c
1266           +++ b/describe.c
1267           @@@ -98,20 -98,12 +98,20 @@@
1268                   return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
1269             }
1270
1271           - static void describe(char *arg)
1272            -static void describe(struct commit *cmit, int last_one)
1273           ++static void describe(char *arg, int last_one)
1274             {
1275            +      unsigned char sha1[20];
1276            +      struct commit *cmit;
1277                   struct commit_list *list;
1278                   static int initialized = 0;
1279                   struct commit_name *n;
1280
1281            +      if (get_sha1(arg, sha1) < 0)
1282            +              usage(describe_usage);
1283            +      cmit = lookup_commit_reference(sha1);
1284            +      if (!cmit)
1285            +              usage(describe_usage);
1286            +
1287                   if (!initialized) {
1288                           initialized = 1;
1289                           for_each_ref(get_name);
1290
1291
1292
1293        1. It is preceded with a "git diff" header, that looks like this (when
1294           the -c option is used):
1295
1296               diff --combined file
1297
1298           or like this (when the --cc option is used):
1299
1300               diff --cc file
1301
1302        2. It is followed by one or more extended header lines (this example
1303           shows a merge with two parents):
1304
1305               index <hash>,<hash>..<hash>
1306               mode <mode>,<mode>..<mode>
1307               new file mode <mode>
1308               deleted file mode <mode>,<mode>
1309
1310           The mode <mode>,<mode>..<mode> line appears only if at least one of
1311           the <mode> is different from the rest. Extended headers with
1312           information about detected contents movement (renames and copying
1313           detection) are designed to work with diff of two <tree-ish> and are
1314           not used by combined diff format.
1315
1316        3. It is followed by two-line from-file/to-file header
1317
1318               --- a/file
1319               +++ b/file
1320
1321           Similar to two-line header for traditional unified diff format,
1322           /dev/null is used to signal created or deleted files.
1323
1324           However, if the --combined-all-paths option is provided, instead of
1325           a two-line from-file/to-file you get a N+1 line from-file/to-file
1326           header, where N is the number of parents in the merge commit
1327
1328               --- a/file
1329               --- a/file
1330               --- a/file
1331               +++ b/file
1332
1333           This extended format can be useful if rename or copy detection is
1334           active, to allow you to see the original name of the file in
1335           different parents.
1336
1337        4. Chunk header format is modified to prevent people from accidentally
1338           feeding it to patch -p1. Combined diff format was created for
1339           review of merge commit changes, and was not meant to be applied.
1340           The change is similar to the change in the extended index header:
1341
1342               @@@ <from-file-range> <from-file-range> <to-file-range> @@@
1343
1344           There are (number of parents + 1) @ characters in the chunk header
1345           for combined diff format.
1346
1347       Unlike the traditional unified diff format, which shows two files A and
1348       B with a single column that has - (minus — appears in A but removed in
1349       B), + (plus — missing in A but added to B), or " " (space — unchanged)
1350       prefix, this format compares two or more files file1, file2,... with
1351       one file X, and shows how X differs from each of fileN. One column for
1352       each of fileN is prepended to the output line to note how X’s line is
1353       different from it.
1354
1355       A - character in the column N means that the line appears in fileN but
1356       it does not appear in the result. A + character in the column N means
1357       that the line appears in the result, and fileN does not have that line
1358       (in other words, the line was added, from the point of view of that
1359       parent).
1360
1361       In the above example output, the function signature was changed from
1362       both files (hence two - removals from both file1 and file2, plus ++ to
1363       mean one line that was added does not appear in either file1 or file2).
1364       Also eight other lines are the same from file1 but do not appear in
1365       file2 (hence prefixed with +).
1366
1367       When shown by git diff-tree -c, it compares the parents of a merge
1368       commit with the merge result (i.e. file1..fileN are the parents). When
1369       shown by git diff-files -c, it compares the two unresolved merge
1370       parents with the working tree file (i.e. file1 is stage 2 aka "our
1371       version", file2 is stage 3 aka "their version").
1372

EXAMPLES

1374       git show v1.0.0
1375           Shows the tag v1.0.0, along with the object the tags points at.
1376
1377       git show v1.0.0^{tree}
1378           Shows the tree pointed to by the tag v1.0.0.
1379
1380       git show -s --format=%s v1.0.0^{commit}
1381           Shows the subject of the commit pointed to by the tag v1.0.0.
1382
1383       git show next~10:Documentation/README
1384           Shows the contents of the file Documentation/README as they were
1385           current in the 10th last commit of the branch next.
1386
1387       git show master:Makefile master:t/Makefile
1388           Concatenates the contents of said Makefiles in the head of the
1389           branch master.
1390

DISCUSSION

1392       Git is to some extent character encoding agnostic.
1393
1394       ·   The contents of the blob objects are uninterpreted sequences of
1395           bytes. There is no encoding translation at the core level.
1396
1397       ·   Path names are encoded in UTF-8 normalization form C. This applies
1398           to tree objects, the index file, ref names, as well as path names
1399           in command line arguments, environment variables and config files
1400           (.git/config (see git-config(1)), gitignore(5), gitattributes(5)
1401           and gitmodules(5)).
1402
1403           Note that Git at the core level treats path names simply as
1404           sequences of non-NUL bytes, there are no path name encoding
1405           conversions (except on Mac and Windows). Therefore, using non-ASCII
1406           path names will mostly work even on platforms and file systems that
1407           use legacy extended ASCII encodings. However, repositories created
1408           on such systems will not work properly on UTF-8-based systems (e.g.
1409           Linux, Mac, Windows) and vice versa. Additionally, many Git-based
1410           tools simply assume path names to be UTF-8 and will fail to display
1411           other encodings correctly.
1412
1413       ·   Commit log messages are typically encoded in UTF-8, but other
1414           extended ASCII encodings are also supported. This includes
1415           ISO-8859-x, CP125x and many others, but not UTF-16/32, EBCDIC and
1416           CJK multi-byte encodings (GBK, Shift-JIS, Big5, EUC-x, CP9xx etc.).
1417
1418       Although we encourage that the commit log messages are encoded in
1419       UTF-8, both the core and Git Porcelain are designed not to force UTF-8
1420       on projects. If all participants of a particular project find it more
1421       convenient to use legacy encodings, Git does not forbid it. However,
1422       there are a few things to keep in mind.
1423
1424        1. git commit and git commit-tree issues a warning if the commit log
1425           message given to it does not look like a valid UTF-8 string, unless
1426           you explicitly say your project uses a legacy encoding. The way to
1427           say this is to have i18n.commitencoding in .git/config file, like
1428           this:
1429
1430               [i18n]
1431                       commitEncoding = ISO-8859-1
1432
1433           Commit objects created with the above setting record the value of
1434           i18n.commitEncoding in its encoding header. This is to help other
1435           people who look at them later. Lack of this header implies that the
1436           commit log message is encoded in UTF-8.
1437
1438        2. git log, git show, git blame and friends look at the encoding
1439           header of a commit object, and try to re-code the log message into
1440           UTF-8 unless otherwise specified. You can specify the desired
1441           output encoding with i18n.logOutputEncoding in .git/config file,
1442           like this:
1443
1444               [i18n]
1445                       logOutputEncoding = ISO-8859-1
1446
1447           If you do not have this configuration variable, the value of
1448           i18n.commitEncoding is used instead.
1449
1450       Note that we deliberately chose not to re-code the commit log message
1451       when a commit is made to force UTF-8 at the commit object level,
1452       because re-coding to UTF-8 is not necessarily a reversible operation.
1453

GIT

1455       Part of the git(1) suite
1456
1457
1458
1459Git 2.24.1                        12/10/2019                       GIT-SHOW(1)
Impressum