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

NAME

6       git-log - Show commit logs
7

SYNOPSIS

9       git log [<options>] [<revision range>] [[--] <path>...]
10
11

DESCRIPTION

13       Shows the commit logs.
14
15       The command takes options applicable to the git rev-list command to
16       control what is shown and how, and options applicable to the git diff-*
17       commands to control how the changes each commit introduces are shown.
18

OPTIONS

20       --follow
21           Continue listing the history of a file beyond renames (works only
22           for a single file).
23
24       --no-decorate, --decorate[=short|full|auto|no]
25           Print out the ref names of any commits that are shown. If short is
26           specified, the ref name prefixes refs/heads/, refs/tags/ and
27           refs/remotes/ will not be printed. If full is specified, the full
28           ref name (including prefix) will be printed. If auto is specified,
29           then if the output is going to a terminal, the ref names are shown
30           as if short were given, otherwise no ref names are shown. The
31           default option is short.
32
33       --decorate-refs=<pattern>, --decorate-refs-exclude=<pattern>
34           If no --decorate-refs is given, pretend as if all refs were
35           included. For each candidate, do not use it for decoration if it
36           matches any patterns given to --decorate-refs-exclude or if it
37           doesn’t match any of the patterns given to --decorate-refs.
38
39       --source
40           Print out the ref name given on the command line by which each
41           commit was reached.
42
43       --use-mailmap
44           Use mailmap file to map author and committer names and email
45           addresses to canonical real names and email addresses. See git-
46           shortlog(1).
47
48       --full-diff
49           Without this flag, git log -p <path>...  shows commits that touch
50           the specified paths, and diffs about the same specified paths. With
51           this, the full diff is shown for commits that touch the specified
52           paths; this means that "<path>..." limits only commits, and doesn’t
53           limit diff for those commits.
54
55           Note that this affects all diff-based output types, e.g. those
56           produced by --stat, etc.
57
58       --log-size
59           Include a line “log size <number>” in the output for each commit,
60           where <number> is the length of that commit’s message in bytes.
61           Intended to speed up tools that read log messages from git log
62           output by allowing them to allocate space in advance.
63
64       -L <start>,<end>:<file>, -L :<funcname>:<file>
65           Trace the evolution of the line range given by "<start>,<end>" (or
66           the function name regex <funcname>) within the <file>. You may not
67           give any pathspec limiters. This is currently limited to a walk
68           starting from a single revision, i.e., you may only give zero or
69           one positive revision arguments. You can specify this option more
70           than once.
71
72           <start> and <end> can take one of these forms:
73
74           ·   number
75
76               If <start> or <end> is a number, it specifies an absolute line
77               number (lines count from 1).
78
79           ·   /regex/
80
81               This form will use the first line matching the given POSIX
82               regex. If <start> is a regex, it will search from the end of
83               the previous -L range, if any, otherwise from the start of
84               file. If <start> is “^/regex/”, it will search from the start
85               of file. If <end> is a regex, it will search starting at the
86               line given by <start>.
87
88           ·   +offset or -offset
89
90               This is only valid for <end> and will specify a number of lines
91               before or after the line given by <start>.
92
93           If “:<funcname>” is given in place of <start> and <end>, it is a
94           regular expression that denotes the range from the first funcname
95           line that matches <funcname>, up to the next funcname line.
96           “:<funcname>” searches from the end of the previous -L range, if
97           any, otherwise from the start of file. “^:<funcname>” searches from
98           the start of file.
99
100       <revision range>
101           Show only commits in the specified revision range. When no
102           <revision range> is specified, it defaults to HEAD (i.e. the whole
103           history leading to the current commit).  origin..HEAD specifies all
104           the commits reachable from the current commit (i.e.  HEAD), but not
105           from origin. For a complete list of ways to spell <revision range>,
106           see the Specifying Ranges section of gitrevisions(7).
107
108       [--] <path>...
109           Show only commits that are enough to explain how the files that
110           match the specified paths came to be. See History Simplification
111           below for details and other simplification modes.
112
113           Paths may need to be prefixed with -- to separate them from options
114           or the revision range, when confusion arises.
115
116   Commit Limiting
117       Besides specifying a range of commits that should be listed using the
118       special notations explained in the description, additional commit
119       limiting may be applied.
120
121       Using more options generally further limits the output (e.g.
122       --since=<date1> limits to commits newer than <date1>, and using it with
123       --grep=<pattern> further limits to commits whose log message has a line
124       that matches <pattern>), unless otherwise noted.
125
126       Note that these are applied before commit ordering and formatting
127       options, such as --reverse.
128
129       -<number>, -n <number>, --max-count=<number>
130           Limit the number of commits to output.
131
132       --skip=<number>
133           Skip number commits before starting to show the commit output.
134
135       --since=<date>, --after=<date>
136           Show commits more recent than a specific date.
137
138       --until=<date>, --before=<date>
139           Show commits older than a specific date.
140
141       --author=<pattern>, --committer=<pattern>
142           Limit the commits output to ones with author/committer header lines
143           that match the specified pattern (regular expression). With more
144           than one --author=<pattern>, commits whose author matches any of
145           the given patterns are chosen (similarly for multiple
146           --committer=<pattern>).
147
148       --grep-reflog=<pattern>
149           Limit the commits output to ones with reflog entries that match the
150           specified pattern (regular expression). With more than one
151           --grep-reflog, commits whose reflog message matches any of the
152           given patterns are chosen. It is an error to use this option unless
153           --walk-reflogs is in use.
154
155       --grep=<pattern>
156           Limit the commits output to ones with log message that matches the
157           specified pattern (regular expression). With more than one
158           --grep=<pattern>, commits whose message matches any of the given
159           patterns are chosen (but see --all-match).
160
161           When --show-notes is in effect, the message from the notes is
162           matched as if it were part of the log message.
163
164       --all-match
165           Limit the commits output to ones that match all given --grep,
166           instead of ones that match at least one.
167
168       --invert-grep
169           Limit the commits output to ones with log message that do not match
170           the pattern specified with --grep=<pattern>.
171
172       -i, --regexp-ignore-case
173           Match the regular expression limiting patterns without regard to
174           letter case.
175
176       --basic-regexp
177           Consider the limiting patterns to be basic regular expressions;
178           this is the default.
179
180       -E, --extended-regexp
181           Consider the limiting patterns to be extended regular expressions
182           instead of the default basic regular expressions.
183
184       -F, --fixed-strings
185           Consider the limiting patterns to be fixed strings (don’t interpret
186           pattern as a regular expression).
187
188       -P, --perl-regexp
189           Consider the limiting patterns to be Perl-compatible regular
190           expressions.
191
192           Support for these types of regular expressions is an optional
193           compile-time dependency. If Git wasn’t compiled with support for
194           them providing this option will cause it to die.
195
196       --remove-empty
197           Stop when a given path disappears from the tree.
198
199       --merges
200           Print only merge commits. This is exactly the same as
201           --min-parents=2.
202
203       --no-merges
204           Do not print commits with more than one parent. This is exactly the
205           same as --max-parents=1.
206
207       --min-parents=<number>, --max-parents=<number>, --no-min-parents,
208       --no-max-parents
209           Show only commits which have at least (or at most) that many parent
210           commits. In particular, --max-parents=1 is the same as --no-merges,
211           --min-parents=2 is the same as --merges.  --max-parents=0 gives all
212           root commits and --min-parents=3 all octopus merges.
213
214           --no-min-parents and --no-max-parents reset these limits (to no
215           limit) again. Equivalent forms are --min-parents=0 (any commit has
216           0 or more parents) and --max-parents=-1 (negative numbers denote no
217           upper limit).
218
219       --first-parent
220           Follow only the first parent commit upon seeing a merge commit.
221           This option can give a better overview when viewing the evolution
222           of a particular topic branch, because merges into a topic branch
223           tend to be only about adjusting to updated upstream from time to
224           time, and this option allows you to ignore the individual commits
225           brought in to your history by such a merge. Cannot be combined with
226           --bisect.
227
228       --not
229           Reverses the meaning of the ^ prefix (or lack thereof) for all
230           following revision specifiers, up to the next --not.
231
232       --all
233           Pretend as if all the refs in refs/, along with HEAD, are listed on
234           the command line as <commit>.
235
236       --branches[=<pattern>]
237           Pretend as if all the refs in refs/heads are listed on the command
238           line as <commit>. If <pattern> is given, limit branches to ones
239           matching given shell glob. If pattern lacks ?, *, or [, /* at the
240           end is implied.
241
242       --tags[=<pattern>]
243           Pretend as if all the refs in refs/tags are listed on the command
244           line as <commit>. If <pattern> is given, limit tags to ones
245           matching given shell glob. If pattern lacks ?, *, or [, /* at the
246           end is implied.
247
248       --remotes[=<pattern>]
249           Pretend as if all the refs in refs/remotes are listed on the
250           command line as <commit>. If <pattern> is given, limit
251           remote-tracking branches to ones matching given shell glob. If
252           pattern lacks ?, *, or [, /* at the end is implied.
253
254       --glob=<glob-pattern>
255           Pretend as if all the refs matching shell glob <glob-pattern> are
256           listed on the command line as <commit>. Leading refs/, is
257           automatically prepended if missing. If pattern lacks ?, *, or [, /*
258           at the end is implied.
259
260       --exclude=<glob-pattern>
261           Do not include refs matching <glob-pattern> that the next --all,
262           --branches, --tags, --remotes, or --glob would otherwise consider.
263           Repetitions of this option accumulate exclusion patterns up to the
264           next --all, --branches, --tags, --remotes, or --glob option (other
265           options or arguments do not clear accumulated patterns).
266
267           The patterns given should not begin with refs/heads, refs/tags, or
268           refs/remotes when applied to --branches, --tags, or --remotes,
269           respectively, and they must begin with refs/ when applied to --glob
270           or --all. If a trailing /* is intended, it must be given
271           explicitly.
272
273       --reflog
274           Pretend as if all objects mentioned by reflogs are listed on the
275           command line as <commit>.
276
277       --single-worktree
278           By default, all working trees will be examined by the following
279           options when there are more than one (see git-worktree(1)): --all,
280           --reflog and --indexed-objects. This option forces them to examine
281           the current working tree only.
282
283       --ignore-missing
284           Upon seeing an invalid object name in the input, pretend as if the
285           bad input was not given.
286
287       --bisect
288           Pretend as if the bad bisection ref refs/bisect/bad was listed and
289           as if it was followed by --not and the good bisection refs
290           refs/bisect/good-* on the command line. Cannot be combined with
291           --first-parent.
292
293       --stdin
294           In addition to the <commit> listed on the command line, read them
295           from the standard input. If a -- separator is seen, stop reading
296           commits and start reading paths to limit the result.
297
298       --cherry-mark
299           Like --cherry-pick (see below) but mark equivalent commits with =
300           rather than omitting them, and inequivalent ones with +.
301
302       --cherry-pick
303           Omit any commit that introduces the same change as another commit
304           on the “other side” when the set of commits are limited with
305           symmetric difference.
306
307           For example, if you have two branches, A and B, a usual way to list
308           all commits on only one side of them is with --left-right (see the
309           example below in the description of the --left-right option).
310           However, it shows the commits that were cherry-picked from the
311           other branch (for example, “3rd on b” may be cherry-picked from
312           branch A). With this option, such pairs of commits are excluded
313           from the output.
314
315       --left-only, --right-only
316           List only commits on the respective side of a symmetric difference,
317           i.e. only those which would be marked < resp.  > by --left-right.
318
319           For example, --cherry-pick --right-only A...B omits those commits
320           from B which are in A or are patch-equivalent to a commit in A. In
321           other words, this lists the + commits from git cherry A B. More
322           precisely, --cherry-pick --right-only --no-merges gives the exact
323           list.
324
325       --cherry
326           A synonym for --right-only --cherry-mark --no-merges; useful to
327           limit the output to the commits on our side and mark those that
328           have been applied to the other side of a forked history with git
329           log --cherry upstream...mybranch, similar to git cherry upstream
330           mybranch.
331
332       -g, --walk-reflogs
333           Instead of walking the commit ancestry chain, walk reflog entries
334           from the most recent one to older ones. When this option is used
335           you cannot specify commits to exclude (that is, ^commit,
336           commit1..commit2, and commit1...commit2 notations cannot be used).
337
338           With --pretty format other than oneline (for obvious reasons), this
339           causes the output to have two extra lines of information taken from
340           the reflog. The reflog designator in the output may be shown as
341           ref@{Nth} (where Nth is the reverse-chronological index in the
342           reflog) or as ref@{timestamp} (with the timestamp for that entry),
343           depending on a few rules:
344
345            1. If the starting point is specified as ref@{Nth}, show the index
346               format.
347
348            2. If the starting point was specified as ref@{now}, show the
349               timestamp format.
350
351            3. If neither was used, but --date was given on the command line,
352               show the timestamp in the format requested by --date.
353
354            4. Otherwise, show the index format.
355
356           Under --pretty=oneline, the commit message is prefixed with this
357           information on the same line. This option cannot be combined with
358           --reverse. See also git-reflog(1).
359
360       --merge
361           After a failed merge, show refs that touch files having a conflict
362           and don’t exist on all heads to merge.
363
364       --boundary
365           Output excluded boundary commits. Boundary commits are prefixed
366           with -.
367
368   History Simplification
369       Sometimes you are only interested in parts of the history, for example
370       the commits modifying a particular <path>. But there are two parts of
371       History Simplification, one part is selecting the commits and the other
372       is how to do it, as there are various strategies to simplify the
373       history.
374
375       The following options select the commits to be shown:
376
377       <paths>
378           Commits modifying the given <paths> are selected.
379
380       --simplify-by-decoration
381           Commits that are referred by some branch or tag are selected.
382
383       Note that extra commits can be shown to give a meaningful history.
384
385       The following options affect the way the simplification is performed:
386
387       Default mode
388           Simplifies the history to the simplest history explaining the final
389           state of the tree. Simplest because it prunes some side branches if
390           the end result is the same (i.e. merging branches with the same
391           content)
392
393       --full-history
394           Same as the default mode, but does not prune some history.
395
396       --dense
397           Only the selected commits are shown, plus some to have a meaningful
398           history.
399
400       --sparse
401           All commits in the simplified history are shown.
402
403       --simplify-merges
404           Additional option to --full-history to remove some needless merges
405           from the resulting history, as there are no selected commits
406           contributing to this merge.
407
408       --ancestry-path
409           When given a range of commits to display (e.g.  commit1..commit2 or
410           commit2 ^commit1), only display commits that exist directly on the
411           ancestry chain between the commit1 and commit2, i.e. commits that
412           are both descendants of commit1, and ancestors of commit2.
413
414       A more detailed explanation follows.
415
416       Suppose you specified foo as the <paths>. We shall call commits that
417       modify foo !TREESAME, and the rest TREESAME. (In a diff filtered for
418       foo, they look different and equal, respectively.)
419
420       In the following, we will always refer to the same example history to
421       illustrate the differences between simplification settings. We assume
422       that you are filtering for a file foo in this commit graph:
423
424                     .-A---M---N---O---P---Q
425                    /     /   /   /   /   /
426                   I     B   C   D   E   Y
427                    \   /   /   /   /   /
428                     `-------------'   X
429
430
431       The horizontal line of history A---Q is taken to be the first parent of
432       each merge. The commits are:
433
434       ·   I is the initial commit, in which foo exists with contents “asdf”,
435           and a file quux exists with contents “quux”. Initial commits are
436           compared to an empty tree, so I is !TREESAME.
437
438       ·   In A, foo contains just “foo”.
439
440       ·   B contains the same change as A. Its merge M is trivial and hence
441           TREESAME to all parents.
442
443       ·   C does not change foo, but its merge N changes it to “foobar”, so
444           it is not TREESAME to any parent.
445
446       ·   D sets foo to “baz”. Its merge O combines the strings from N and D
447           to “foobarbaz”; i.e., it is not TREESAME to any parent.
448
449       ·   E changes quux to “xyzzy”, and its merge P combines the strings to
450           “quux xyzzy”.  P is TREESAME to O, but not to E.
451
452       ·   X is an independent root commit that added a new file side, and Y
453           modified it.  Y is TREESAME to X. Its merge Q added side to P, and
454           Q is TREESAME to P, but not to Y.
455
456       rev-list walks backwards through history, including or excluding
457       commits based on whether --full-history and/or parent rewriting (via
458       --parents or --children) are used. The following settings are
459       available.
460
461       Default mode
462           Commits are included if they are not TREESAME to any parent (though
463           this can be changed, see --sparse below). If the commit was a
464           merge, and it was TREESAME to one parent, follow only that parent.
465           (Even if there are several TREESAME parents, follow only one of
466           them.) Otherwise, follow all parents.
467
468           This results in:
469
470                         .-A---N---O
471                        /     /   /
472                       I---------D
473
474           Note how the rule to only follow the TREESAME parent, if one is
475           available, removed B from consideration entirely.  C was considered
476           via N, but is TREESAME. Root commits are compared to an empty tree,
477           so I is !TREESAME.
478
479           Parent/child relations are only visible with --parents, but that
480           does not affect the commits selected in default mode, so we have
481           shown the parent lines.
482
483       --full-history without parent rewriting
484           This mode differs from the default in one point: always follow all
485           parents of a merge, even if it is TREESAME to one of them. Even if
486           more than one side of the merge has commits that are included, this
487           does not imply that the merge itself is! In the example, we get
488
489                       I  A  B  N  D  O  P  Q
490
491           M was excluded because it is TREESAME to both parents.  E, C and B
492           were all walked, but only B was !TREESAME, so the others do not
493           appear.
494
495           Note that without parent rewriting, it is not really possible to
496           talk about the parent/child relationships between the commits, so
497           we show them disconnected.
498
499       --full-history with parent rewriting
500           Ordinary commits are only included if they are !TREESAME (though
501           this can be changed, see --sparse below).
502
503           Merges are always included. However, their parent list is
504           rewritten: Along each parent, prune away commits that are not
505           included themselves. This results in
506
507                         .-A---M---N---O---P---Q
508                        /     /   /   /   /
509                       I     B   /   D   /
510                        \   /   /   /   /
511                         `-------------'
512
513           Compare to --full-history without rewriting above. Note that E was
514           pruned away because it is TREESAME, but the parent list of P was
515           rewritten to contain E's parent I. The same happened for C and N,
516           and X, Y and Q.
517
518       In addition to the above settings, you can change whether TREESAME
519       affects inclusion:
520
521       --dense
522           Commits that are walked are included if they are not TREESAME to
523           any parent.
524
525       --sparse
526           All commits that are walked are included.
527
528           Note that without --full-history, this still simplifies merges: if
529           one of the parents is TREESAME, we follow only that one, so the
530           other sides of the merge are never walked.
531
532       --simplify-merges
533           First, build a history graph in the same way that --full-history
534           with parent rewriting does (see above).
535
536           Then simplify each commit C to its replacement C' in the final
537           history according to the following rules:
538
539           ·   Set C' to C.
540
541           ·   Replace each parent P of C' with its simplification P'. In the
542               process, drop parents that are ancestors of other parents or
543               that are root commits TREESAME to an empty tree, and remove
544               duplicates, but take care to never drop all parents that we are
545               TREESAME to.
546
547           ·   If after this parent rewriting, C' is a root or merge commit
548               (has zero or >1 parents), a boundary commit, or !TREESAME, it
549               remains. Otherwise, it is replaced with its only parent.
550
551           The effect of this is best shown by way of comparing to
552           --full-history with parent rewriting. The example turns into:
553
554                         .-A---M---N---O
555                        /     /       /
556                       I     B       D
557                        \   /       /
558                         `---------'
559
560           Note the major differences in N, P, and Q over --full-history:
561
562           ·   N's parent list had I removed, because it is an ancestor of the
563               other parent M. Still, N remained because it is !TREESAME.
564
565           ·   P's parent list similarly had I removed.  P was then removed
566               completely, because it had one parent and is TREESAME.
567
568           ·   Q's parent list had Y simplified to X.  X was then removed,
569               because it was a TREESAME root.  Q was then removed completely,
570               because it had one parent and is TREESAME.
571
572       Finally, there is a fifth simplification mode available:
573
574       --ancestry-path
575           Limit the displayed commits to those directly on the ancestry chain
576           between the “from” and “to” commits in the given commit range. I.e.
577           only display commits that are ancestor of the “to” commit and
578           descendants of the “from” commit.
579
580           As an example use case, consider the following commit history:
581
582                           D---E-------F
583                          /     \       \
584                         B---C---G---H---I---J
585                        /                     \
586                       A-------K---------------L--M
587
588           A regular D..M computes the set of commits that are ancestors of M,
589           but excludes the ones that are ancestors of D. This is useful to
590           see what happened to the history leading to M since D, in the sense
591           that “what does M have that did not exist in D”. The result in this
592           example would be all the commits, except A and B (and D itself, of
593           course).
594
595           When we want to find out what commits in M are contaminated with
596           the bug introduced by D and need fixing, however, we might want to
597           view only the subset of D..M that are actually descendants of D,
598           i.e. excluding C and K. This is exactly what the --ancestry-path
599           option does. Applied to the D..M range, it results in:
600
601                               E-------F
602                                \       \
603                                 G---H---I---J
604                                              \
605                                               L--M
606
607
608       The --simplify-by-decoration option allows you to view only the big
609       picture of the topology of the history, by omitting commits that are
610       not referenced by tags. Commits are marked as !TREESAME (in other
611       words, kept after history simplification rules described above) if (1)
612       they are referenced by tags, or (2) they change the contents of the
613       paths given on the command line. All other commits are marked as
614       TREESAME (subject to be simplified away).
615
616   Commit Ordering
617       By default, the commits are shown in reverse chronological order.
618
619       --date-order
620           Show no parents before all of its children are shown, but otherwise
621           show commits in the commit timestamp order.
622
623       --author-date-order
624           Show no parents before all of its children are shown, but otherwise
625           show commits in the author timestamp order.
626
627       --topo-order
628           Show no parents before all of its children are shown, and avoid
629           showing commits on multiple lines of history intermixed.
630
631           For example, in a commit history like this:
632
633                   ---1----2----4----7
634                       \              \
635                        3----5----6----8---
636
637           where the numbers denote the order of commit timestamps, git
638           rev-list and friends with --date-order show the commits in the
639           timestamp order: 8 7 6 5 4 3 2 1.
640
641           With --topo-order, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5
642           3 1); some older commits are shown before newer ones in order to
643           avoid showing the commits from two parallel development track mixed
644           together.
645
646       --reverse
647           Output the commits chosen to be shown (see Commit Limiting section
648           above) in reverse order. Cannot be combined with --walk-reflogs.
649
650   Object Traversal
651       These options are mostly targeted for packing of Git repositories.
652
653       --exclude-promisor-objects
654           (For internal use only.) Prefilter object traversal at promisor
655           boundary. This is used with partial clone. This is stronger than
656           --missing=allow-promisor because it limits the traversal, rather
657           than just silencing errors about missing objects.
658
659       --no-walk[=(sorted|unsorted)]
660           Only show the given commits, but do not traverse their ancestors.
661           This has no effect if a range is specified. If the argument
662           unsorted is given, the commits are shown in the order they were
663           given on the command line. Otherwise (if sorted or no argument was
664           given), the commits are shown in reverse chronological order by
665           commit time. Cannot be combined with --graph.
666
667       --do-walk
668           Overrides a previous --no-walk.
669
670   Commit Formatting
671       --pretty[=<format>], --format=<format>
672           Pretty-print the contents of the commit logs in a given format,
673           where <format> can be one of oneline, short, medium, full, fuller,
674           email, raw, format:<string> and tformat:<string>. When <format> is
675           none of the above, and has %placeholder in it, it acts as if
676           --pretty=tformat:<format> were given.
677
678           See the "PRETTY FORMATS" section for some additional details for
679           each format. When =<format> part is omitted, it defaults to medium.
680
681           Note: you can specify the default pretty format in the repository
682           configuration (see git-config(1)).
683
684       --abbrev-commit
685           Instead of showing the full 40-byte hexadecimal commit object name,
686           show only a partial prefix. Non default number of digits can be
687           specified with "--abbrev=<n>" (which also modifies diff output, if
688           it is displayed).
689
690           This should make "--pretty=oneline" a whole lot more readable for
691           people using 80-column terminals.
692
693       --no-abbrev-commit
694           Show the full 40-byte hexadecimal commit object name. This negates
695           --abbrev-commit and those options which imply it such as
696           "--oneline". It also overrides the log.abbrevCommit variable.
697
698       --oneline
699           This is a shorthand for "--pretty=oneline --abbrev-commit" used
700           together.
701
702       --encoding=<encoding>
703           The commit objects record the encoding used for the log message in
704           their encoding header; this option can be used to tell the command
705           to re-code the commit log message in the encoding preferred by the
706           user. For non plumbing commands this defaults to UTF-8. Note that
707           if an object claims to be encoded in X and we are outputting in X,
708           we will output the object verbatim; this means that invalid
709           sequences in the original commit may be copied to the output.
710
711       --expand-tabs=<n>, --expand-tabs, --no-expand-tabs
712           Perform a tab expansion (replace each tab with enough spaces to
713           fill to the next display column that is multiple of <n>) in the log
714           message before showing it in the output.  --expand-tabs is a
715           short-hand for --expand-tabs=8, and --no-expand-tabs is a
716           short-hand for --expand-tabs=0, which disables tab expansion.
717
718           By default, tabs are expanded in pretty formats that indent the log
719           message by 4 spaces (i.e.  medium, which is the default, full, and
720           fuller).
721
722       --notes[=<treeish>]
723           Show the notes (see git-notes(1)) that annotate the commit, when
724           showing the commit log message. This is the default for git log,
725           git show and git whatchanged commands when there is no --pretty,
726           --format, or --oneline option given on the command line.
727
728           By default, the notes shown are from the notes refs listed in the
729           core.notesRef and notes.displayRef variables (or corresponding
730           environment overrides). See git-config(1) for more details.
731
732           With an optional <treeish> argument, use the treeish to find the
733           notes to display. The treeish can specify the full refname when it
734           begins with refs/notes/; when it begins with notes/, refs/ and
735           otherwise refs/notes/ is prefixed to form a full name of the ref.
736
737           Multiple --notes options can be combined to control which notes are
738           being displayed. Examples: "--notes=foo" will show only notes from
739           "refs/notes/foo"; "--notes=foo --notes" will show both notes from
740           "refs/notes/foo" and from the default notes ref(s).
741
742       --no-notes
743           Do not show notes. This negates the above --notes option, by
744           resetting the list of notes refs from which notes are shown.
745           Options are parsed in the order given on the command line, so e.g.
746           "--notes --notes=foo --no-notes --notes=bar" will only show notes
747           from "refs/notes/bar".
748
749       --show-notes[=<treeish>], --[no-]standard-notes
750           These options are deprecated. Use the above --notes/--no-notes
751           options instead.
752
753       --show-signature
754           Check the validity of a signed commit object by passing the
755           signature to gpg --verify and show the output.
756
757       --relative-date
758           Synonym for --date=relative.
759
760       --date=<format>
761           Only takes effect for dates shown in human-readable format, such as
762           when using --pretty.  log.date config variable sets a default value
763           for the log command’s --date option. By default, dates are shown in
764           the original time zone (either committer’s or author’s). If -local
765           is appended to the format (e.g., iso-local), the user’s local time
766           zone is used instead.
767
768           --date=relative shows dates relative to the current time, e.g. “2
769           hours ago”. The -local option has no effect for --date=relative.
770
771           --date=local is an alias for --date=default-local.
772
773           --date=iso (or --date=iso8601) shows timestamps in a ISO 8601-like
774           format. The differences to the strict ISO 8601 format are:
775
776           ·   a space instead of the T date/time delimiter
777
778           ·   a space between time and time zone
779
780           ·   no colon between hours and minutes of the time zone
781
782           --date=iso-strict (or --date=iso8601-strict) shows timestamps in
783           strict ISO 8601 format.
784
785           --date=rfc (or --date=rfc2822) shows timestamps in RFC 2822 format,
786           often found in email messages.
787
788           --date=short shows only the date, but not the time, in YYYY-MM-DD
789           format.
790
791           --date=raw shows the date as seconds since the epoch (1970-01-01
792           00:00:00 UTC), followed by a space, and then the timezone as an
793           offset from UTC (a + or - with four digits; the first two are
794           hours, and the second two are minutes). I.e., as if the timestamp
795           were formatted with strftime("%s %z")). Note that the -local option
796           does not affect the seconds-since-epoch value (which is always
797           measured in UTC), but does switch the accompanying timezone value.
798
799           --date=unix shows the date as a Unix epoch timestamp (seconds since
800           1970). As with --raw, this is always in UTC and therefore -local
801           has no effect.
802
803           --date=format:...  feeds the format ...  to your system strftime,
804           except for %z and %Z, which are handled internally. Use
805           --date=format:%c to show the date in your system locale’s preferred
806           format. See the strftime manual for a complete list of format
807           placeholders. When using -local, the correct syntax is
808           --date=format-local:....
809
810           --date=default is the default format, and is similar to
811           --date=rfc2822, with a few exceptions:
812
813           ·   there is no comma after the day-of-week
814
815           ·   the time zone is omitted when the local time zone is used
816
817       --parents
818           Print also the parents of the commit (in the form "commit
819           parent..."). Also enables parent rewriting, see History
820           Simplification above.
821
822       --children
823           Print also the children of the commit (in the form "commit
824           child..."). Also enables parent rewriting, see History
825           Simplification above.
826
827       --left-right
828           Mark which side of a symmetric difference a commit is reachable
829           from. Commits from the left side are prefixed with < and those from
830           the right with >. If combined with --boundary, those commits are
831           prefixed with -.
832
833           For example, if you have this topology:
834
835                            y---b---b  branch B
836                           / \ /
837                          /   .
838                         /   / \
839                        o---x---a---a  branch A
840
841           you would get an output like this:
842
843                       $ git rev-list --left-right --boundary --pretty=oneline A...B
844
845                       >bbbbbbb... 3rd on b
846                       >bbbbbbb... 2nd on b
847                       <aaaaaaa... 3rd on a
848                       <aaaaaaa... 2nd on a
849                       -yyyyyyy... 1st on b
850                       -xxxxxxx... 1st on a
851
852
853       --graph
854           Draw a text-based graphical representation of the commit history on
855           the left hand side of the output. This may cause extra lines to be
856           printed in between commits, in order for the graph history to be
857           drawn properly. Cannot be combined with --no-walk.
858
859           This enables parent rewriting, see History Simplification above.
860
861           This implies the --topo-order option by default, but the
862           --date-order option may also be specified.
863
864       --show-linear-break[=<barrier>]
865           When --graph is not used, all history branches are flattened which
866           can make it hard to see that the two consecutive commits do not
867           belong to a linear branch. This option puts a barrier in between
868           them in that case. If <barrier> is specified, it is the string that
869           will be shown instead of the default one.
870
871   Diff Formatting
872       Listed below are options that control the formatting of diff output.
873       Some of them are specific to git-rev-list(1), however other diff
874       options may be given. See git-diff-files(1) for more options.
875
876       -c
877           With this option, diff output for a merge commit shows the
878           differences from each of the parents to the merge result
879           simultaneously instead of showing pairwise diff between a parent
880           and the result one at a time. Furthermore, it lists only files
881           which were modified from all parents.
882
883       --cc
884           This flag implies the -c option and further compresses the patch
885           output by omitting uninteresting hunks whose contents in the
886           parents have only two variants and the merge result picks one of
887           them without modification.
888
889       -m
890           This flag makes the merge commits show the full diff like regular
891           commits; for each merge parent, a separate log entry and diff is
892           generated. An exception is that only diff against the first parent
893           is shown when --first-parent option is given; in that case, the
894           output represents the changes the merge brought into the
895           then-current branch.
896
897       -r
898           Show recursive diffs.
899
900       -t
901           Show the tree objects in the diff output. This implies -r.
902

PRETTY FORMATS

904       If the commit is a merge, and if the pretty-format is not oneline,
905       email or raw, an additional line is inserted before the Author: line.
906       This line begins with "Merge: " and the sha1s of ancestral commits are
907       printed, separated by spaces. Note that the listed commits may not
908       necessarily be the list of the direct parent commits if you have
909       limited your view of history: for example, if you are only interested
910       in changes related to a certain directory or file.
911
912       There are several built-in formats, and you can define additional
913       formats by setting a pretty.<name> config option to either another
914       format name, or a format: string, as described below (see git-
915       config(1)). Here are the details of the built-in formats:
916
917       ·   oneline
918
919               <sha1> <title line>
920
921           This is designed to be as compact as possible.
922
923       ·   short
924
925               commit <sha1>
926               Author: <author>
927
928               <title line>
929
930       ·   medium
931
932               commit <sha1>
933               Author: <author>
934               Date:   <author date>
935
936               <title line>
937
938               <full commit message>
939
940       ·   full
941
942               commit <sha1>
943               Author: <author>
944               Commit: <committer>
945
946               <title line>
947
948               <full commit message>
949
950       ·   fuller
951
952               commit <sha1>
953               Author:     <author>
954               AuthorDate: <author date>
955               Commit:     <committer>
956               CommitDate: <committer date>
957
958               <title line>
959
960               <full commit message>
961
962       ·   email
963
964               From <sha1> <date>
965               From: <author>
966               Date: <author date>
967               Subject: [PATCH] <title line>
968
969               <full commit message>
970
971       ·   raw
972
973           The raw format shows the entire commit exactly as stored in the
974           commit object. Notably, the SHA-1s are displayed in full,
975           regardless of whether --abbrev or --no-abbrev are used, and parents
976           information show the true parent commits, without taking grafts or
977           history simplification into account. Note that this format affects
978           the way commits are displayed, but not the way the diff is shown
979           e.g. with git log --raw. To get full object names in a raw diff
980           format, use --no-abbrev.
981
982       ·   format:<string>
983
984           The format:<string> format allows you to specify which information
985           you want to show. It works a little bit like printf format, with
986           the notable exception that you get a newline with %n instead of \n.
987
988           E.g, format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"
989           would show something like this:
990
991               The author of fe6e0ee was Junio C Hamano, 23 hours ago
992               The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<
993
994           The placeholders are:
995
996           ·   %H: commit hash
997
998           ·   %h: abbreviated commit hash
999
1000           ·   %T: tree hash
1001
1002           ·   %t: abbreviated tree hash
1003
1004           ·   %P: parent hashes
1005
1006           ·   %p: abbreviated parent hashes
1007
1008           ·   %an: author name
1009
1010           ·   %aN: author name (respecting .mailmap, see git-shortlog(1) or
1011               git-blame(1))
1012
1013           ·   %ae: author email
1014
1015           ·   %aE: author email (respecting .mailmap, see git-shortlog(1) or
1016               git-blame(1))
1017
1018           ·   %ad: author date (format respects --date= option)
1019
1020           ·   %aD: author date, RFC2822 style
1021
1022           ·   %ar: author date, relative
1023
1024           ·   %at: author date, UNIX timestamp
1025
1026           ·   %ai: author date, ISO 8601-like format
1027
1028           ·   %aI: author date, strict ISO 8601 format
1029
1030           ·   %cn: committer name
1031
1032           ·   %cN: committer name (respecting .mailmap, see git-shortlog(1)
1033               or git-blame(1))
1034
1035           ·   %ce: committer email
1036
1037           ·   %cE: committer email (respecting .mailmap, see git-shortlog(1)
1038               or git-blame(1))
1039
1040           ·   %cd: committer date (format respects --date= option)
1041
1042           ·   %cD: committer date, RFC2822 style
1043
1044           ·   %cr: committer date, relative
1045
1046           ·   %ct: committer date, UNIX timestamp
1047
1048           ·   %ci: committer date, ISO 8601-like format
1049
1050           ·   %cI: committer date, strict ISO 8601 format
1051
1052           ·   %d: ref names, like the --decorate option of git-log(1)
1053
1054           ·   %D: ref names without the " (", ")" wrapping.
1055
1056           ·   %e: encoding
1057
1058           ·   %s: subject
1059
1060           ·   %f: sanitized subject line, suitable for a filename
1061
1062           ·   %b: body
1063
1064           ·   %B: raw body (unwrapped subject and body)
1065
1066           ·   %N: commit notes
1067
1068           ·   %GG: raw verification message from GPG for a signed commit
1069
1070           ·   %G?: show "G" for a good (valid) signature, "B" for a bad
1071               signature, "U" for a good signature with unknown validity, "X"
1072               for a good signature that has expired, "Y" for a good signature
1073               made by an expired key, "R" for a good signature made by a
1074               revoked key, "E" if the signature cannot be checked (e.g.
1075               missing key) and "N" for no signature
1076
1077           ·   %GS: show the name of the signer for a signed commit
1078
1079           ·   %GK: show the key used to sign a signed commit
1080
1081           ·   %gD: reflog selector, e.g., refs/stash@{1} or refs/stash@{2
1082               minutes ago}; the format follows the rules described for the -g
1083               option. The portion before the @ is the refname as given on the
1084               command line (so git log -g refs/heads/master would yield
1085               refs/heads/master@{0}).
1086
1087           ·   %gd: shortened reflog selector; same as %gD, but the refname
1088               portion is shortened for human readability (so
1089               refs/heads/master becomes just master).
1090
1091           ·   %gn: reflog identity name
1092
1093           ·   %gN: reflog identity name (respecting .mailmap, see git-
1094               shortlog(1) or git-blame(1))
1095
1096           ·   %ge: reflog identity email
1097
1098           ·   %gE: reflog identity email (respecting .mailmap, see git-
1099               shortlog(1) or git-blame(1))
1100
1101           ·   %gs: reflog subject
1102
1103           ·   %Cred: switch color to red
1104
1105           ·   %Cgreen: switch color to green
1106
1107           ·   %Cblue: switch color to blue
1108
1109           ·   %Creset: reset color
1110
1111           ·   %C(...): color specification, as described under Values in the
1112               "CONFIGURATION FILE" section of git-config(1). By default,
1113               colors are shown only when enabled for log output (by
1114               color.diff, color.ui, or --color, and respecting the auto
1115               settings of the former if we are going to a terminal).
1116               %C(auto,...)  is accepted as a historical synonym for the
1117               default (e.g., %C(auto,red)). Specifying %C(always,...) will
1118               show the colors even when color is not otherwise enabled
1119               (though consider just using `--color=always to enable color for
1120               the whole output, including this format and anything else git
1121               might color).  auto alone (i.e.  %C(auto)) will turn on auto
1122               coloring on the next placeholders until the color is switched
1123               again.
1124
1125           ·   %m: left (<), right (>) or boundary (-) mark
1126
1127           ·   %n: newline
1128
1129           ·   %%: a raw %
1130
1131           ·   %x00: print a byte from a hex code
1132
1133           ·   %w([<w>[,<i1>[,<i2>]]]): switch line wrapping, like the -w
1134               option of git-shortlog(1).
1135
1136           ·   %<(<N>[,trunc|ltrunc|mtrunc]): make the next placeholder take
1137               at least N columns, padding spaces on the right if necessary.
1138               Optionally truncate at the beginning (ltrunc), the middle
1139               (mtrunc) or the end (trunc) if the output is longer than N
1140               columns. Note that truncating only works correctly with N >= 2.
1141
1142           ·   %<|(<N>): make the next placeholder take at least until Nth
1143               columns, padding spaces on the right if necessary
1144
1145           ·   %>(<N>), %>|(<N>): similar to %<(<N>), %<|(<N>) respectively,
1146               but padding spaces on the left
1147
1148           ·   %>>(<N>), %>>|(<N>): similar to %>(<N>), %>|(<N>) respectively,
1149               except that if the next placeholder takes more spaces than
1150               given and there are spaces on its left, use those spaces
1151
1152           ·   %><(<N>), %><|(<N>): similar to %<(<N>), %<|(<N>) respectively,
1153               but padding both sides (i.e. the text is centered)
1154
1155           ·   %(trailers[:options]): display the trailers of the body as
1156               interpreted by git-interpret-trailers(1). The trailers string
1157               may be followed by a colon and zero or more comma-separated
1158               options. If the only option is given, omit non-trailer lines
1159               from the trailer block. If the unfold option is given, behave
1160               as if interpret-trailer’s --unfold option was given. E.g.,
1161               %(trailers:only,unfold) to do both.
1162
1163           Note
1164           Some placeholders may depend on other options given to the revision
1165           traversal engine. For example, the %g* reflog options will insert
1166           an empty string unless we are traversing reflog entries (e.g., by
1167           git log -g). The %d and %D placeholders will use the "short"
1168           decoration format if --decorate was not already provided on the
1169           command line.
1170
1171       If you add a + (plus sign) after % of a placeholder, a line-feed is
1172       inserted immediately before the expansion if and only if the
1173       placeholder expands to a non-empty string.
1174
1175       If you add a - (minus sign) after % of a placeholder, all consecutive
1176       line-feeds immediately preceding the expansion are deleted if and only
1177       if the placeholder expands to an empty string.
1178
1179       If you add a ` ` (space) after % of a placeholder, a space is inserted
1180       immediately before the expansion if and only if the placeholder expands
1181       to a non-empty string.
1182
1183       ·   tformat:
1184
1185           The tformat: format works exactly like format:, except that it
1186           provides "terminator" semantics instead of "separator" semantics.
1187           In other words, each commit has the message terminator character
1188           (usually a newline) appended, rather than a separator placed
1189           between entries. This means that the final entry of a single-line
1190           format will be properly terminated with a new line, just as the
1191           "oneline" format does. For example:
1192
1193               $ git log -2 --pretty=format:%h 4da45bef \
1194                 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
1195               4da45be
1196               7134973 -- NO NEWLINE
1197
1198               $ git log -2 --pretty=tformat:%h 4da45bef \
1199                 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
1200               4da45be
1201               7134973
1202
1203           In addition, any unrecognized string that has a % in it is
1204           interpreted as if it has tformat: in front of it. For example,
1205           these two are equivalent:
1206
1207               $ git log -2 --pretty=tformat:%h 4da45bef
1208               $ git log -2 --pretty=%h 4da45bef
1209
1210

COMMON DIFF OPTIONS

1212       -p, -u, --patch
1213           Generate patch (see section on generating patches).
1214
1215       -s, --no-patch
1216           Suppress diff output. Useful for commands like git show that show
1217           the patch by default, or to cancel the effect of --patch.
1218
1219       -U<n>, --unified=<n>
1220           Generate diffs with <n> lines of context instead of the usual
1221           three. Implies -p.
1222
1223       --raw
1224           For each commit, show a summary of changes using the raw diff
1225           format. See the "RAW OUTPUT FORMAT" section of git-diff(1). This is
1226           different from showing the log itself in raw format, which you can
1227           achieve with --format=raw.
1228
1229       --patch-with-raw
1230           Synonym for -p --raw.
1231
1232       --indent-heuristic
1233           Enable the heuristic that shifts diff hunk boundaries to make
1234           patches easier to read. This is the default.
1235
1236       --no-indent-heuristic
1237           Disable the indent heuristic.
1238
1239       --minimal
1240           Spend extra time to make sure the smallest possible diff is
1241           produced.
1242
1243       --patience
1244           Generate a diff using the "patience diff" algorithm.
1245
1246       --histogram
1247           Generate a diff using the "histogram diff" algorithm.
1248
1249       --anchored=<text>
1250           Generate a diff using the "anchored diff" algorithm.
1251
1252           This option may be specified more than once.
1253
1254           If a line exists in both the source and destination, exists only
1255           once, and starts with this text, this algorithm attempts to prevent
1256           it from appearing as a deletion or addition in the output. It uses
1257           the "patience diff" algorithm internally.
1258
1259       --diff-algorithm={patience|minimal|histogram|myers}
1260           Choose a diff algorithm. The variants are as follows:
1261
1262           default, myers
1263               The basic greedy diff algorithm. Currently, this is the
1264               default.
1265
1266           minimal
1267               Spend extra time to make sure the smallest possible diff is
1268               produced.
1269
1270           patience
1271               Use "patience diff" algorithm when generating patches.
1272
1273           histogram
1274               This algorithm extends the patience algorithm to "support
1275               low-occurrence common elements".
1276
1277           For instance, if you configured the diff.algorithm variable to a
1278           non-default value and want to use the default one, then you have to
1279           use --diff-algorithm=default option.
1280
1281       --stat[=<width>[,<name-width>[,<count>]]]
1282           Generate a diffstat. By default, as much space as necessary will be
1283           used for the filename part, and the rest for the graph part.
1284           Maximum width defaults to terminal width, or 80 columns if not
1285           connected to a terminal, and can be overridden by <width>. The
1286           width of the filename part can be limited by giving another width
1287           <name-width> after a comma. The width of the graph part can be
1288           limited by using --stat-graph-width=<width> (affects all commands
1289           generating a stat graph) or by setting diff.statGraphWidth=<width>
1290           (does not affect git format-patch). By giving a third parameter
1291           <count>, you can limit the output to the first <count> lines,
1292           followed by ...  if there are more.
1293
1294           These parameters can also be set individually with
1295           --stat-width=<width>, --stat-name-width=<name-width> and
1296           --stat-count=<count>.
1297
1298       --compact-summary
1299           Output a condensed summary of extended header information such as
1300           file creations or deletions ("new" or "gone", optionally "+l" if
1301           it’s a symlink) and mode changes ("+x" or "-x" for adding or
1302           removing executable bit respectively) in diffstat. The information
1303           is put between the filename part and the graph part. Implies
1304           --stat.
1305
1306       --numstat
1307           Similar to --stat, but shows number of added and deleted lines in
1308           decimal notation and pathname without abbreviation, to make it more
1309           machine friendly. For binary files, outputs two - instead of saying
1310           0 0.
1311
1312       --shortstat
1313           Output only the last line of the --stat format containing total
1314           number of modified files, as well as number of added and deleted
1315           lines.
1316
1317       --dirstat[=<param1,param2,...>]
1318           Output the distribution of relative amount of changes for each
1319           sub-directory. The behavior of --dirstat can be customized by
1320           passing it a comma separated list of parameters. The defaults are
1321           controlled by the diff.dirstat configuration variable (see git-
1322           config(1)). The following parameters are available:
1323
1324           changes
1325               Compute the dirstat numbers by counting the lines that have
1326               been removed from the source, or added to the destination. This
1327               ignores the amount of pure code movements within a file. In
1328               other words, rearranging lines in a file is not counted as much
1329               as other changes. This is the default behavior when no
1330               parameter is given.
1331
1332           lines
1333               Compute the dirstat numbers by doing the regular line-based
1334               diff analysis, and summing the removed/added line counts. (For
1335               binary files, count 64-byte chunks instead, since binary files
1336               have no natural concept of lines). This is a more expensive
1337               --dirstat behavior than the changes behavior, but it does count
1338               rearranged lines within a file as much as other changes. The
1339               resulting output is consistent with what you get from the other
1340               --*stat options.
1341
1342           files
1343               Compute the dirstat numbers by counting the number of files
1344               changed. Each changed file counts equally in the dirstat
1345               analysis. This is the computationally cheapest --dirstat
1346               behavior, since it does not have to look at the file contents
1347               at all.
1348
1349           cumulative
1350               Count changes in a child directory for the parent directory as
1351               well. Note that when using cumulative, the sum of the
1352               percentages reported may exceed 100%. The default
1353               (non-cumulative) behavior can be specified with the
1354               noncumulative parameter.
1355
1356           <limit>
1357               An integer parameter specifies a cut-off percent (3% by
1358               default). Directories contributing less than this percentage of
1359               the changes are not shown in the output.
1360
1361           Example: The following will count changed files, while ignoring
1362           directories with less than 10% of the total amount of changed
1363           files, and accumulating child directory counts in the parent
1364           directories: --dirstat=files,10,cumulative.
1365
1366       --summary
1367           Output a condensed summary of extended header information such as
1368           creations, renames and mode changes.
1369
1370       --patch-with-stat
1371           Synonym for -p --stat.
1372
1373       -z
1374           Separate the commits with NULs instead of with new newlines.
1375
1376           Also, when --raw or --numstat has been given, do not munge
1377           pathnames and use NULs as output field terminators.
1378
1379           Without this option, pathnames with "unusual" characters are quoted
1380           as explained for the configuration variable core.quotePath (see
1381           git-config(1)).
1382
1383       --name-only
1384           Show only names of changed files.
1385
1386       --name-status
1387           Show only names and status of changed files. See the description of
1388           the --diff-filter option on what the status letters mean.
1389
1390       --submodule[=<format>]
1391           Specify how differences in submodules are shown. When specifying
1392           --submodule=short the short format is used. This format just shows
1393           the names of the commits at the beginning and end of the range.
1394           When --submodule or --submodule=log is specified, the log format is
1395           used. This format lists the commits in the range like git-
1396           submodule(1) summary does. When --submodule=diff is specified, the
1397           diff format is used. This format shows an inline diff of the
1398           changes in the submodule contents between the commit range.
1399           Defaults to diff.submodule or the short format if the config option
1400           is unset.
1401
1402       --color[=<when>]
1403           Show colored diff.  --color (i.e. without =<when>) is the same as
1404           --color=always.  <when> can be one of always, never, or auto.
1405
1406       --no-color
1407           Turn off colored diff. It is the same as --color=never.
1408
1409       --color-moved[=<mode>]
1410           Moved lines of code are colored differently. The <mode> defaults to
1411           no if the option is not given and to zebra if the option with no
1412           mode is given. The mode must be one of:
1413
1414           no
1415               Moved lines are not highlighted.
1416
1417           default
1418               Is a synonym for zebra. This may change to a more sensible mode
1419               in the future.
1420
1421           plain
1422               Any line that is added in one location and was removed in
1423               another location will be colored with color.diff.newMoved.
1424               Similarly color.diff.oldMoved will be used for removed lines
1425               that are added somewhere else in the diff. This mode picks up
1426               any moved line, but it is not very useful in a review to
1427               determine if a block of code was moved without permutation.
1428
1429           zebra
1430               Blocks of moved text of at least 20 alphanumeric characters are
1431               detected greedily. The detected blocks are painted using either
1432               the color.diff.{old,new}Moved color or
1433               color.diff.{old,new}MovedAlternative. The change between the
1434               two colors indicates that a new block was detected.
1435
1436           dimmed_zebra
1437               Similar to zebra, but additional dimming of uninteresting parts
1438               of moved code is performed. The bordering lines of two adjacent
1439               blocks are considered interesting, the rest is uninteresting.
1440
1441       --word-diff[=<mode>]
1442           Show a word diff, using the <mode> to delimit changed words. By
1443           default, words are delimited by whitespace; see --word-diff-regex
1444           below. The <mode> defaults to plain, and must be one of:
1445
1446           color
1447               Highlight changed words using only colors. Implies --color.
1448
1449           plain
1450               Show words as [-removed-] and {+added+}. Makes no attempts to
1451               escape the delimiters if they appear in the input, so the
1452               output may be ambiguous.
1453
1454           porcelain
1455               Use a special line-based format intended for script
1456               consumption. Added/removed/unchanged runs are printed in the
1457               usual unified diff format, starting with a +/-/` ` character at
1458               the beginning of the line and extending to the end of the line.
1459               Newlines in the input are represented by a tilde ~ on a line of
1460               its own.
1461
1462           none
1463               Disable word diff again.
1464
1465           Note that despite the name of the first mode, color is used to
1466           highlight the changed parts in all modes if enabled.
1467
1468       --word-diff-regex=<regex>
1469           Use <regex> to decide what a word is, instead of considering runs
1470           of non-whitespace to be a word. Also implies --word-diff unless it
1471           was already enabled.
1472
1473           Every non-overlapping match of the <regex> is considered a word.
1474           Anything between these matches is considered whitespace and
1475           ignored(!) for the purposes of finding differences. You may want to
1476           append |[^[:space:]] to your regular expression to make sure that
1477           it matches all non-whitespace characters. A match that contains a
1478           newline is silently truncated(!) at the newline.
1479
1480           For example, --word-diff-regex=.  will treat each character as a
1481           word and, correspondingly, show differences character by character.
1482
1483           The regex can also be set via a diff driver or configuration
1484           option, see gitattributes(5) or git-config(1). Giving it explicitly
1485           overrides any diff driver or configuration setting. Diff drivers
1486           override configuration settings.
1487
1488       --color-words[=<regex>]
1489           Equivalent to --word-diff=color plus (if a regex was specified)
1490           --word-diff-regex=<regex>.
1491
1492       --no-renames
1493           Turn off rename detection, even when the configuration file gives
1494           the default to do so.
1495
1496       --check
1497           Warn if changes introduce conflict markers or whitespace errors.
1498           What are considered whitespace errors is controlled by
1499           core.whitespace configuration. By default, trailing whitespaces
1500           (including lines that consist solely of whitespaces) and a space
1501           character that is immediately followed by a tab character inside
1502           the initial indent of the line are considered whitespace errors.
1503           Exits with non-zero status if problems are found. Not compatible
1504           with --exit-code.
1505
1506       --ws-error-highlight=<kind>
1507           Highlight whitespace errors in the context, old or new lines of the
1508           diff. Multiple values are separated by comma, none resets previous
1509           values, default reset the list to new and all is a shorthand for
1510           old,new,context. When this option is not given, and the
1511           configuration variable diff.wsErrorHighlight is not set, only
1512           whitespace errors in new lines are highlighted. The whitespace
1513           errors are colored with color.diff.whitespace.
1514
1515       --full-index
1516           Instead of the first handful of characters, show the full pre- and
1517           post-image blob object names on the "index" line when generating
1518           patch format output.
1519
1520       --binary
1521           In addition to --full-index, output a binary diff that can be
1522           applied with git-apply.
1523
1524       --abbrev[=<n>]
1525           Instead of showing the full 40-byte hexadecimal object name in
1526           diff-raw format output and diff-tree header lines, show only a
1527           partial prefix. This is independent of the --full-index option
1528           above, which controls the diff-patch output format. Non default
1529           number of digits can be specified with --abbrev=<n>.
1530
1531       -B[<n>][/<m>], --break-rewrites[=[<n>][/<m>]]
1532           Break complete rewrite changes into pairs of delete and create.
1533           This serves two purposes:
1534
1535           It affects the way a change that amounts to a total rewrite of a
1536           file not as a series of deletion and insertion mixed together with
1537           a very few lines that happen to match textually as the context, but
1538           as a single deletion of everything old followed by a single
1539           insertion of everything new, and the number m controls this aspect
1540           of the -B option (defaults to 60%).  -B/70% specifies that less
1541           than 30% of the original should remain in the result for Git to
1542           consider it a total rewrite (i.e. otherwise the resulting patch
1543           will be a series of deletion and insertion mixed together with
1544           context lines).
1545
1546           When used with -M, a totally-rewritten file is also considered as
1547           the source of a rename (usually -M only considers a file that
1548           disappeared as the source of a rename), and the number n controls
1549           this aspect of the -B option (defaults to 50%).  -B20% specifies
1550           that a change with addition and deletion compared to 20% or more of
1551           the file’s size are eligible for being picked up as a possible
1552           source of a rename to another file.
1553
1554       -M[<n>], --find-renames[=<n>]
1555           If generating diffs, detect and report renames for each commit. For
1556           following files across renames while traversing history, see
1557           --follow. If n is specified, it is a threshold on the similarity
1558           index (i.e. amount of addition/deletions compared to the file’s
1559           size). For example, -M90% means Git should consider a delete/add
1560           pair to be a rename if more than 90% of the file hasn’t changed.
1561           Without a % sign, the number is to be read as a fraction, with a
1562           decimal point before it. I.e., -M5 becomes 0.5, and is thus the
1563           same as -M50%. Similarly, -M05 is the same as -M5%. To limit
1564           detection to exact renames, use -M100%. The default similarity
1565           index is 50%.
1566
1567       -C[<n>], --find-copies[=<n>]
1568           Detect copies as well as renames. See also --find-copies-harder. If
1569           n is specified, it has the same meaning as for -M<n>.
1570
1571       --find-copies-harder
1572           For performance reasons, by default, -C option finds copies only if
1573           the original file of the copy was modified in the same changeset.
1574           This flag makes the command inspect unmodified files as candidates
1575           for the source of copy. This is a very expensive operation for
1576           large projects, so use it with caution. Giving more than one -C
1577           option has the same effect.
1578
1579       -D, --irreversible-delete
1580           Omit the preimage for deletes, i.e. print only the header but not
1581           the diff between the preimage and /dev/null. The resulting patch is
1582           not meant to be applied with patch or git apply; this is solely for
1583           people who want to just concentrate on reviewing the text after the
1584           change. In addition, the output obviously lacks enough information
1585           to apply such a patch in reverse, even manually, hence the name of
1586           the option.
1587
1588           When used together with -B, omit also the preimage in the deletion
1589           part of a delete/create pair.
1590
1591       -l<num>
1592           The -M and -C options require O(n^2) processing time where n is the
1593           number of potential rename/copy targets. This option prevents
1594           rename/copy detection from running if the number of rename/copy
1595           targets exceeds the specified number.
1596
1597       --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]
1598           Select only files that are Added (A), Copied (C), Deleted (D),
1599           Modified (M), Renamed (R), have their type (i.e. regular file,
1600           symlink, submodule, ...) changed (T), are Unmerged (U), are Unknown
1601           (X), or have had their pairing Broken (B). Any combination of the
1602           filter characters (including none) can be used. When *
1603           (All-or-none) is added to the combination, all paths are selected
1604           if there is any file that matches other criteria in the comparison;
1605           if there is no file that matches other criteria, nothing is
1606           selected.
1607
1608           Also, these upper-case letters can be downcased to exclude. E.g.
1609           --diff-filter=ad excludes added and deleted paths.
1610
1611           Note that not all diffs can feature all types. For instance, diffs
1612           from the index to the working tree can never have Added entries
1613           (because the set of paths included in the diff is limited by what
1614           is in the index). Similarly, copied and renamed entries cannot
1615           appear if detection for those types is disabled.
1616
1617       -S<string>
1618           Look for differences that change the number of occurrences of the
1619           specified string (i.e. addition/deletion) in a file. Intended for
1620           the scripter’s use.
1621
1622           It is useful when you’re looking for an exact block of code (like a
1623           struct), and want to know the history of that block since it first
1624           came into being: use the feature iteratively to feed the
1625           interesting block in the preimage back into -S, and keep going
1626           until you get the very first version of the block.
1627
1628       -G<regex>
1629           Look for differences whose patch text contains added/removed lines
1630           that match <regex>.
1631
1632           To illustrate the difference between -S<regex> --pickaxe-regex and
1633           -G<regex>, consider a commit with the following diff in the same
1634           file:
1635
1636               +    return !regexec(regexp, two->ptr, 1, &regmatch, 0);
1637               ...
1638               -    hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);
1639
1640           While git log -G"regexec\(regexp" will show this commit, git log
1641           -S"regexec\(regexp" --pickaxe-regex will not (because the number of
1642           occurrences of that string did not change).
1643
1644           See the pickaxe entry in gitdiffcore(7) for more information.
1645
1646       --find-object=<object-id>
1647           Look for differences that change the number of occurrences of the
1648           specified object. Similar to -S, just the argument is different in
1649           that it doesn’t search for a specific string but for a specific
1650           object id.
1651
1652           The object can be a blob or a submodule commit. It implies the -t
1653           option in git-log to also find trees.
1654
1655       --pickaxe-all
1656           When -S or -G finds a change, show all the changes in that
1657           changeset, not just the files that contain the change in <string>.
1658
1659       --pickaxe-regex
1660           Treat the <string> given to -S as an extended POSIX regular
1661           expression to match.
1662
1663       -O<orderfile>
1664           Control the order in which files appear in the output. This
1665           overrides the diff.orderFile configuration variable (see git-
1666           config(1)). To cancel diff.orderFile, use -O/dev/null.
1667
1668           The output order is determined by the order of glob patterns in
1669           <orderfile>. All files with pathnames that match the first pattern
1670           are output first, all files with pathnames that match the second
1671           pattern (but not the first) are output next, and so on. All files
1672           with pathnames that do not match any pattern are output last, as if
1673           there was an implicit match-all pattern at the end of the file. If
1674           multiple pathnames have the same rank (they match the same pattern
1675           but no earlier patterns), their output order relative to each other
1676           is the normal order.
1677
1678           <orderfile> is parsed as follows:
1679
1680           ·   Blank lines are ignored, so they can be used as separators for
1681               readability.
1682
1683           ·   Lines starting with a hash ("#") are ignored, so they can be
1684               used for comments. Add a backslash ("\") to the beginning of
1685               the pattern if it starts with a hash.
1686
1687           ·   Each other line contains a single pattern.
1688
1689           Patterns have the same syntax and semantics as patterns used for
1690           fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
1691           matches a pattern if removing any number of the final pathname
1692           components matches the pattern. For example, the pattern "foo*bar"
1693           matches "fooasdfbar" and "foo/bar/baz/asdf" but not "foobarx".
1694
1695       -R
1696           Swap two inputs; that is, show differences from index or on-disk
1697           file to tree contents.
1698
1699       --relative[=<path>]
1700           When run from a subdirectory of the project, it can be told to
1701           exclude changes outside the directory and show pathnames relative
1702           to it with this option. When you are not in a subdirectory (e.g. in
1703           a bare repository), you can name which subdirectory to make the
1704           output relative to by giving a <path> as an argument.
1705
1706       -a, --text
1707           Treat all files as text.
1708
1709       --ignore-cr-at-eol
1710           Ignore carriage-return at the end of line when doing a comparison.
1711
1712       --ignore-space-at-eol
1713           Ignore changes in whitespace at EOL.
1714
1715       -b, --ignore-space-change
1716           Ignore changes in amount of whitespace. This ignores whitespace at
1717           line end, and considers all other sequences of one or more
1718           whitespace characters to be equivalent.
1719
1720       -w, --ignore-all-space
1721           Ignore whitespace when comparing lines. This ignores differences
1722           even if one line has whitespace where the other line has none.
1723
1724       --ignore-blank-lines
1725           Ignore changes whose lines are all blank.
1726
1727       --inter-hunk-context=<lines>
1728           Show the context between diff hunks, up to the specified number of
1729           lines, thereby fusing hunks that are close to each other. Defaults
1730           to diff.interHunkContext or 0 if the config option is unset.
1731
1732       -W, --function-context
1733           Show whole surrounding functions of changes.
1734
1735       --ext-diff
1736           Allow an external diff helper to be executed. If you set an
1737           external diff driver with gitattributes(5), you need to use this
1738           option with git-log(1) and friends.
1739
1740       --no-ext-diff
1741           Disallow external diff drivers.
1742
1743       --textconv, --no-textconv
1744           Allow (or disallow) external text conversion filters to be run when
1745           comparing binary files. See gitattributes(5) for details. Because
1746           textconv filters are typically a one-way conversion, the resulting
1747           diff is suitable for human consumption, but cannot be applied. For
1748           this reason, textconv filters are enabled by default only for git-
1749           diff(1) and git-log(1), but not for git-format-patch(1) or diff
1750           plumbing commands.
1751
1752       --ignore-submodules[=<when>]
1753           Ignore changes to submodules in the diff generation. <when> can be
1754           either "none", "untracked", "dirty" or "all", which is the default.
1755           Using "none" will consider the submodule modified when it either
1756           contains untracked or modified files or its HEAD differs from the
1757           commit recorded in the superproject and can be used to override any
1758           settings of the ignore option in git-config(1) or gitmodules(5).
1759           When "untracked" is used submodules are not considered dirty when
1760           they only contain untracked content (but they are still scanned for
1761           modified content). Using "dirty" ignores all changes to the work
1762           tree of submodules, only changes to the commits stored in the
1763           superproject are shown (this was the behavior until 1.7.0). Using
1764           "all" hides all changes to submodules.
1765
1766       --src-prefix=<prefix>
1767           Show the given source prefix instead of "a/".
1768
1769       --dst-prefix=<prefix>
1770           Show the given destination prefix instead of "b/".
1771
1772       --no-prefix
1773           Do not show any source or destination prefix.
1774
1775       --line-prefix=<prefix>
1776           Prepend an additional prefix to every line of output.
1777
1778       --ita-invisible-in-index
1779           By default entries added by "git add -N" appear as an existing
1780           empty file in "git diff" and a new file in "git diff --cached".
1781           This option makes the entry appear as a new file in "git diff" and
1782           non-existent in "git diff --cached". This option could be reverted
1783           with --ita-visible-in-index. Both options are experimental and
1784           could be removed in future.
1785
1786       For more detailed explanation on these common options, see also
1787       gitdiffcore(7).
1788

GENERATING PATCHES WITH -P

1790       When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
1791       with a -p option, "git diff" without the --raw option, or "git log"
1792       with the "-p" option, they do not produce the output described above;
1793       instead they produce a patch file. You can customize the creation of
1794       such patches via the GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS
1795       environment variables.
1796
1797       What the -p option produces is slightly different from the traditional
1798       diff format:
1799
1800        1. It is preceded with a "git diff" header that looks like this:
1801
1802               diff --git a/file1 b/file2
1803
1804           The a/ and b/ filenames are the same unless rename/copy is
1805           involved. Especially, even for a creation or a deletion, /dev/null
1806           is not used in place of the a/ or b/ filenames.
1807
1808           When rename/copy is involved, file1 and file2 show the name of the
1809           source file of the rename/copy and the name of the file that
1810           rename/copy produces, respectively.
1811
1812        2. It is followed by one or more extended header lines:
1813
1814               old mode <mode>
1815               new mode <mode>
1816               deleted file mode <mode>
1817               new file mode <mode>
1818               copy from <path>
1819               copy to <path>
1820               rename from <path>
1821               rename to <path>
1822               similarity index <number>
1823               dissimilarity index <number>
1824               index <hash>..<hash> <mode>
1825
1826           File modes are printed as 6-digit octal numbers including the file
1827           type and file permission bits.
1828
1829           Path names in extended headers do not include the a/ and b/
1830           prefixes.
1831
1832           The similarity index is the percentage of unchanged lines, and the
1833           dissimilarity index is the percentage of changed lines. It is a
1834           rounded down integer, followed by a percent sign. The similarity
1835           index value of 100% is thus reserved for two equal files, while
1836           100% dissimilarity means that no line from the old file made it
1837           into the new one.
1838
1839           The index line includes the SHA-1 checksum before and after the
1840           change. The <mode> is included if the file mode does not change;
1841           otherwise, separate lines indicate the old and the new mode.
1842
1843        3. Pathnames with "unusual" characters are quoted as explained for the
1844           configuration variable core.quotePath (see git-config(1)).
1845
1846        4. All the file1 files in the output refer to files before the commit,
1847           and all the file2 files refer to files after the commit. It is
1848           incorrect to apply each change to each file sequentially. For
1849           example, this patch will swap a and b:
1850
1851               diff --git a/a b/b
1852               rename from a
1853               rename to b
1854               diff --git a/b b/a
1855               rename from b
1856               rename to a
1857

COMBINED DIFF FORMAT

1859       Any diff-generating command can take the -c or --cc option to produce a
1860       combined diff when showing a merge. This is the default format when
1861       showing merges with git-diff(1) or git-show(1). Note also that you can
1862       give the -m option to any of these commands to force generation of
1863       diffs with individual parents of a merge.
1864
1865       A combined diff format looks like this:
1866
1867           diff --combined describe.c
1868           index fabadb8,cc95eb0..4866510
1869           --- a/describe.c
1870           +++ b/describe.c
1871           @@@ -98,20 -98,12 +98,20 @@@
1872                   return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1;
1873             }
1874
1875           - static void describe(char *arg)
1876            -static void describe(struct commit *cmit, int last_one)
1877           ++static void describe(char *arg, int last_one)
1878             {
1879            +      unsigned char sha1[20];
1880            +      struct commit *cmit;
1881                   struct commit_list *list;
1882                   static int initialized = 0;
1883                   struct commit_name *n;
1884
1885            +      if (get_sha1(arg, sha1) < 0)
1886            +              usage(describe_usage);
1887            +      cmit = lookup_commit_reference(sha1);
1888            +      if (!cmit)
1889            +              usage(describe_usage);
1890            +
1891                   if (!initialized) {
1892                           initialized = 1;
1893                           for_each_ref(get_name);
1894
1895
1896
1897        1. It is preceded with a "git diff" header, that looks like this (when
1898           -c option is used):
1899
1900               diff --combined file
1901
1902           or like this (when --cc option is used):
1903
1904               diff --cc file
1905
1906        2. It is followed by one or more extended header lines (this example
1907           shows a merge with two parents):
1908
1909               index <hash>,<hash>..<hash>
1910               mode <mode>,<mode>..<mode>
1911               new file mode <mode>
1912               deleted file mode <mode>,<mode>
1913
1914           The mode <mode>,<mode>..<mode> line appears only if at least one of
1915           the <mode> is different from the rest. Extended headers with
1916           information about detected contents movement (renames and copying
1917           detection) are designed to work with diff of two <tree-ish> and are
1918           not used by combined diff format.
1919
1920        3. It is followed by two-line from-file/to-file header
1921
1922               --- a/file
1923               +++ b/file
1924
1925           Similar to two-line header for traditional unified diff format,
1926           /dev/null is used to signal created or deleted files.
1927
1928        4. Chunk header format is modified to prevent people from accidentally
1929           feeding it to patch -p1. Combined diff format was created for
1930           review of merge commit changes, and was not meant for apply. The
1931           change is similar to the change in the extended index header:
1932
1933               @@@ <from-file-range> <from-file-range> <to-file-range> @@@
1934
1935           There are (number of parents + 1) @ characters in the chunk header
1936           for combined diff format.
1937
1938       Unlike the traditional unified diff format, which shows two files A and
1939       B with a single column that has - (minus — appears in A but removed in
1940       B), + (plus — missing in A but added to B), or " " (space — unchanged)
1941       prefix, this format compares two or more files file1, file2,... with
1942       one file X, and shows how X differs from each of fileN. One column for
1943       each of fileN is prepended to the output line to note how X’s line is
1944       different from it.
1945
1946       A - character in the column N means that the line appears in fileN but
1947       it does not appear in the result. A + character in the column N means
1948       that the line appears in the result, and fileN does not have that line
1949       (in other words, the line was added, from the point of view of that
1950       parent).
1951
1952       In the above example output, the function signature was changed from
1953       both files (hence two - removals from both file1 and file2, plus ++ to
1954       mean one line that was added does not appear in either file1 or file2).
1955       Also eight other lines are the same from file1 but do not appear in
1956       file2 (hence prefixed with +).
1957
1958       When shown by git diff-tree -c, it compares the parents of a merge
1959       commit with the merge result (i.e. file1..fileN are the parents). When
1960       shown by git diff-files -c, it compares the two unresolved merge
1961       parents with the working tree file (i.e. file1 is stage 2 aka "our
1962       version", file2 is stage 3 aka "their version").
1963

EXAMPLES

1965       git log --no-merges
1966           Show the whole commit history, but skip any merges
1967
1968       git log v2.6.12.. include/scsi drivers/scsi
1969           Show all commits since version v2.6.12 that changed any file in the
1970           include/scsi or drivers/scsi subdirectories
1971
1972       git log --since="2 weeks ago" -- gitk
1973           Show the changes during the last two weeks to the file gitk. The --
1974           is necessary to avoid confusion with the branch named gitk
1975
1976       git log --name-status release..test
1977           Show the commits that are in the "test" branch but not yet in the
1978           "release" branch, along with the list of paths each commit
1979           modifies.
1980
1981       git log --follow builtin/rev-list.c
1982           Shows the commits that changed builtin/rev-list.c, including those
1983           commits that occurred before the file was given its present name.
1984
1985       git log --branches --not --remotes=origin
1986           Shows all commits that are in any of local branches but not in any
1987           of remote-tracking branches for origin (what you have that origin
1988           doesn’t).
1989
1990       git log master --not --remotes=*/master
1991           Shows all commits that are in local master but not in any remote
1992           repository master branches.
1993
1994       git log -p -m --first-parent
1995           Shows the history including change diffs, but only from the “main
1996           branch” perspective, skipping commits that come from merged
1997           branches, and showing full diffs of changes introduced by the
1998           merges. This makes sense only when following a strict policy of
1999           merging all topic branches when staying on a single integration
2000           branch.
2001
2002       git log -L '/int main/',/^}/:main.c
2003           Shows how the function main() in the file main.c evolved over time.
2004
2005       git log -3
2006           Limits the number of commits to show to 3.
2007

DISCUSSION

2009       Git is to some extent character encoding agnostic.
2010
2011       ·   The contents of the blob objects are uninterpreted sequences of
2012           bytes. There is no encoding translation at the core level.
2013
2014       ·   Path names are encoded in UTF-8 normalization form C. This applies
2015           to tree objects, the index file, ref names, as well as path names
2016           in command line arguments, environment variables and config files
2017           (.git/config (see git-config(1)), gitignore(5), gitattributes(5)
2018           and gitmodules(5)).
2019
2020           Note that Git at the core level treats path names simply as
2021           sequences of non-NUL bytes, there are no path name encoding
2022           conversions (except on Mac and Windows). Therefore, using non-ASCII
2023           path names will mostly work even on platforms and file systems that
2024           use legacy extended ASCII encodings. However, repositories created
2025           on such systems will not work properly on UTF-8-based systems (e.g.
2026           Linux, Mac, Windows) and vice versa. Additionally, many Git-based
2027           tools simply assume path names to be UTF-8 and will fail to display
2028           other encodings correctly.
2029
2030       ·   Commit log messages are typically encoded in UTF-8, but other
2031           extended ASCII encodings are also supported. This includes
2032           ISO-8859-x, CP125x and many others, but not UTF-16/32, EBCDIC and
2033           CJK multi-byte encodings (GBK, Shift-JIS, Big5, EUC-x, CP9xx etc.).
2034
2035       Although we encourage that the commit log messages are encoded in
2036       UTF-8, both the core and Git Porcelain are designed not to force UTF-8
2037       on projects. If all participants of a particular project find it more
2038       convenient to use legacy encodings, Git does not forbid it. However,
2039       there are a few things to keep in mind.
2040
2041        1. git commit and git commit-tree issues a warning if the commit log
2042           message given to it does not look like a valid UTF-8 string, unless
2043           you explicitly say your project uses a legacy encoding. The way to
2044           say this is to have i18n.commitencoding in .git/config file, like
2045           this:
2046
2047               [i18n]
2048                       commitEncoding = ISO-8859-1
2049
2050           Commit objects created with the above setting record the value of
2051           i18n.commitEncoding in its encoding header. This is to help other
2052           people who look at them later. Lack of this header implies that the
2053           commit log message is encoded in UTF-8.
2054
2055        2. git log, git show, git blame and friends look at the encoding
2056           header of a commit object, and try to re-code the log message into
2057           UTF-8 unless otherwise specified. You can specify the desired
2058           output encoding with i18n.logOutputEncoding in .git/config file,
2059           like this:
2060
2061               [i18n]
2062                       logOutputEncoding = ISO-8859-1
2063
2064           If you do not have this configuration variable, the value of
2065           i18n.commitEncoding is used instead.
2066
2067       Note that we deliberately chose not to re-code the commit log message
2068       when a commit is made to force UTF-8 at the commit object level,
2069       because re-coding to UTF-8 is not necessarily a reversible operation.
2070

CONFIGURATION

2072       See git-config(1) for core variables and git-diff(1) for settings
2073       related to diff generation.
2074
2075       format.pretty
2076           Default for the --format option. (See Pretty Formats above.)
2077           Defaults to medium.
2078
2079       i18n.logOutputEncoding
2080           Encoding to use when displaying logs. (See Discussion above.)
2081           Defaults to the value of i18n.commitEncoding if set, and UTF-8
2082           otherwise.
2083
2084       log.date
2085           Default format for human-readable dates. (Compare the --date
2086           option.) Defaults to "default", which means to write dates like Sat
2087           May 8 19:35:34 2010 -0500.
2088
2089       log.follow
2090           If true, git log will act as if the --follow option was used when a
2091           single <path> is given. This has the same limitations as --follow,
2092           i.e. it cannot be used to follow multiple files and does not work
2093           well on non-linear history.
2094
2095       log.showRoot
2096           If false, git log and related commands will not treat the initial
2097           commit as a big creation event. Any root commits in git log -p
2098           output would be shown without a diff attached. The default is true.
2099
2100       log.showSignature
2101           If true, git log and related commands will act as if the
2102           --show-signature option was passed to them.
2103
2104       mailmap.*
2105           See git-shortlog(1).
2106
2107       notes.displayRef
2108           Which refs, in addition to the default set by core.notesRef or
2109           GIT_NOTES_REF, to read notes from when showing commit messages with
2110           the log family of commands. See git-notes(1).
2111
2112           May be an unabbreviated ref name or a glob and may be specified
2113           multiple times. A warning will be issued for refs that do not
2114           exist, but a glob that does not match any refs is silently ignored.
2115
2116           This setting can be disabled by the --no-notes option, overridden
2117           by the GIT_NOTES_DISPLAY_REF environment variable, and overridden
2118           by the --notes=<ref> option.
2119

GIT

2121       Part of the git(1) suite
2122
2123
2124
2125Git 2.18.1                        05/14/2019                        GIT-LOG(1)
Impressum