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       --no-walk[=(sorted|unsorted)]
654           Only show the given commits, but do not traverse their ancestors.
655           This has no effect if a range is specified. If the argument
656           unsorted is given, the commits are shown in the order they were
657           given on the command line. Otherwise (if sorted or no argument was
658           given), the commits are shown in reverse chronological order by
659           commit time. Cannot be combined with --graph.
660
661       --do-walk
662           Overrides a previous --no-walk.
663
664   Commit Formatting
665       --pretty[=<format>], --format=<format>
666           Pretty-print the contents of the commit logs in a given format,
667           where <format> can be one of oneline, short, medium, full, fuller,
668           email, raw, format:<string> and tformat:<string>. When <format> is
669           none of the above, and has %placeholder in it, it acts as if
670           --pretty=tformat:<format> were given.
671
672           See the "PRETTY FORMATS" section for some additional details for
673           each format. When =<format> part is omitted, it defaults to medium.
674
675           Note: you can specify the default pretty format in the repository
676           configuration (see git-config(1)).
677
678       --abbrev-commit
679           Instead of showing the full 40-byte hexadecimal commit object name,
680           show only a partial prefix. Non default number of digits can be
681           specified with "--abbrev=<n>" (which also modifies diff output, if
682           it is displayed).
683
684           This should make "--pretty=oneline" a whole lot more readable for
685           people using 80-column terminals.
686
687       --no-abbrev-commit
688           Show the full 40-byte hexadecimal commit object name. This negates
689           --abbrev-commit and those options which imply it such as
690           "--oneline". It also overrides the log.abbrevCommit variable.
691
692       --oneline
693           This is a shorthand for "--pretty=oneline --abbrev-commit" used
694           together.
695
696       --encoding=<encoding>
697           The commit objects record the encoding used for the log message in
698           their encoding header; this option can be used to tell the command
699           to re-code the commit log message in the encoding preferred by the
700           user. For non plumbing commands this defaults to UTF-8. Note that
701           if an object claims to be encoded in X and we are outputting in X,
702           we will output the object verbatim; this means that invalid
703           sequences in the original commit may be copied to the output.
704
705       --expand-tabs=<n>, --expand-tabs, --no-expand-tabs
706           Perform a tab expansion (replace each tab with enough spaces to
707           fill to the next display column that is multiple of <n>) in the log
708           message before showing it in the output.  --expand-tabs is a
709           short-hand for --expand-tabs=8, and --no-expand-tabs is a
710           short-hand for --expand-tabs=0, which disables tab expansion.
711
712           By default, tabs are expanded in pretty formats that indent the log
713           message by 4 spaces (i.e.  medium, which is the default, full, and
714           fuller).
715
716       --notes[=<treeish>]
717           Show the notes (see git-notes(1)) that annotate the commit, when
718           showing the commit log message. This is the default for git log,
719           git show and git whatchanged commands when there is no --pretty,
720           --format, or --oneline option given on the command line.
721
722           By default, the notes shown are from the notes refs listed in the
723           core.notesRef and notes.displayRef variables (or corresponding
724           environment overrides). See git-config(1) for more details.
725
726           With an optional <treeish> argument, use the treeish to find the
727           notes to display. The treeish can specify the full refname when it
728           begins with refs/notes/; when it begins with notes/, refs/ and
729           otherwise refs/notes/ is prefixed to form a full name of the ref.
730
731           Multiple --notes options can be combined to control which notes are
732           being displayed. Examples: "--notes=foo" will show only notes from
733           "refs/notes/foo"; "--notes=foo --notes" will show both notes from
734           "refs/notes/foo" and from the default notes ref(s).
735
736       --no-notes
737           Do not show notes. This negates the above --notes option, by
738           resetting the list of notes refs from which notes are shown.
739           Options are parsed in the order given on the command line, so e.g.
740           "--notes --notes=foo --no-notes --notes=bar" will only show notes
741           from "refs/notes/bar".
742
743       --show-notes[=<treeish>], --[no-]standard-notes
744           These options are deprecated. Use the above --notes/--no-notes
745           options instead.
746
747       --show-signature
748           Check the validity of a signed commit object by passing the
749           signature to gpg --verify and show the output.
750
751       --relative-date
752           Synonym for --date=relative.
753
754       --date=<format>
755           Only takes effect for dates shown in human-readable format, such as
756           when using --pretty.  log.date config variable sets a default value
757           for the log command’s --date option. By default, dates are shown in
758           the original time zone (either committer’s or author’s). If -local
759           is appended to the format (e.g., iso-local), the user’s local time
760           zone is used instead.
761
762           --date=relative shows dates relative to the current time, e.g. “2
763           hours ago”. The -local option has no effect for --date=relative.
764
765           --date=local is an alias for --date=default-local.
766
767           --date=iso (or --date=iso8601) shows timestamps in a ISO 8601-like
768           format. The differences to the strict ISO 8601 format are:
769
770           ·   a space instead of the T date/time delimiter
771
772           ·   a space between time and time zone
773
774           ·   no colon between hours and minutes of the time zone
775
776           --date=iso-strict (or --date=iso8601-strict) shows timestamps in
777           strict ISO 8601 format.
778
779           --date=rfc (or --date=rfc2822) shows timestamps in RFC 2822 format,
780           often found in email messages.
781
782           --date=short shows only the date, but not the time, in YYYY-MM-DD
783           format.
784
785           --date=raw shows the date as seconds since the epoch (1970-01-01
786           00:00:00 UTC), followed by a space, and then the timezone as an
787           offset from UTC (a + or - with four digits; the first two are
788           hours, and the second two are minutes). I.e., as if the timestamp
789           were formatted with strftime("%s %z")). Note that the -local option
790           does not affect the seconds-since-epoch value (which is always
791           measured in UTC), but does switch the accompanying timezone value.
792
793           --date=unix shows the date as a Unix epoch timestamp (seconds since
794           1970). As with --raw, this is always in UTC and therefore -local
795           has no effect.
796
797           --date=format:...  feeds the format ...  to your system strftime,
798           except for %z and %Z, which are handled internally. Use
799           --date=format:%c to show the date in your system locale’s preferred
800           format. See the strftime manual for a complete list of format
801           placeholders. When using -local, the correct syntax is
802           --date=format-local:....
803
804           --date=default is the default format, and is similar to
805           --date=rfc2822, with a few exceptions:
806
807           ·   there is no comma after the day-of-week
808
809           ·   the time zone is omitted when the local time zone is used
810
811       --parents
812           Print also the parents of the commit (in the form "commit
813           parent..."). Also enables parent rewriting, see History
814           Simplification above.
815
816       --children
817           Print also the children of the commit (in the form "commit
818           child..."). Also enables parent rewriting, see History
819           Simplification above.
820
821       --left-right
822           Mark which side of a symmetric difference a commit is reachable
823           from. Commits from the left side are prefixed with < and those from
824           the right with >. If combined with --boundary, those commits are
825           prefixed with -.
826
827           For example, if you have this topology:
828
829                            y---b---b  branch B
830                           / \ /
831                          /   .
832                         /   / \
833                        o---x---a---a  branch A
834
835           you would get an output like this:
836
837                       $ git rev-list --left-right --boundary --pretty=oneline A...B
838
839                       >bbbbbbb... 3rd on b
840                       >bbbbbbb... 2nd on b
841                       <aaaaaaa... 3rd on a
842                       <aaaaaaa... 2nd on a
843                       -yyyyyyy... 1st on b
844                       -xxxxxxx... 1st on a
845
846
847       --graph
848           Draw a text-based graphical representation of the commit history on
849           the left hand side of the output. This may cause extra lines to be
850           printed in between commits, in order for the graph history to be
851           drawn properly. Cannot be combined with --no-walk.
852
853           This enables parent rewriting, see History Simplification above.
854
855           This implies the --topo-order option by default, but the
856           --date-order option may also be specified.
857
858       --show-linear-break[=<barrier>]
859           When --graph is not used, all history branches are flattened which
860           can make it hard to see that the two consecutive commits do not
861           belong to a linear branch. This option puts a barrier in between
862           them in that case. If <barrier> is specified, it is the string that
863           will be shown instead of the default one.
864
865   Diff Formatting
866       Listed below are options that control the formatting of diff output.
867       Some of them are specific to git-rev-list(1), however other diff
868       options may be given. See git-diff-files(1) for more options.
869
870       -c
871           With this option, diff output for a merge commit shows the
872           differences from each of the parents to the merge result
873           simultaneously instead of showing pairwise diff between a parent
874           and the result one at a time. Furthermore, it lists only files
875           which were modified from all parents.
876
877       --cc
878           This flag implies the -c option and further compresses the patch
879           output by omitting uninteresting hunks whose contents in the
880           parents have only two variants and the merge result picks one of
881           them without modification.
882
883       -m
884           This flag makes the merge commits show the full diff like regular
885           commits; for each merge parent, a separate log entry and diff is
886           generated. An exception is that only diff against the first parent
887           is shown when --first-parent option is given; in that case, the
888           output represents the changes the merge brought into the
889           then-current branch.
890
891       -r
892           Show recursive diffs.
893
894       -t
895           Show the tree objects in the diff output. This implies -r.
896

PRETTY FORMATS

898       If the commit is a merge, and if the pretty-format is not oneline,
899       email or raw, an additional line is inserted before the Author: line.
900       This line begins with "Merge: " and the sha1s of ancestral commits are
901       printed, separated by spaces. Note that the listed commits may not
902       necessarily be the list of the direct parent commits if you have
903       limited your view of history: for example, if you are only interested
904       in changes related to a certain directory or file.
905
906       There are several built-in formats, and you can define additional
907       formats by setting a pretty.<name> config option to either another
908       format name, or a format: string, as described below (see git-
909       config(1)). Here are the details of the built-in formats:
910
911       ·   oneline
912
913               <sha1> <title line>
914
915           This is designed to be as compact as possible.
916
917       ·   short
918
919               commit <sha1>
920               Author: <author>
921
922               <title line>
923
924       ·   medium
925
926               commit <sha1>
927               Author: <author>
928               Date:   <author date>
929
930               <title line>
931
932               <full commit message>
933
934       ·   full
935
936               commit <sha1>
937               Author: <author>
938               Commit: <committer>
939
940               <title line>
941
942               <full commit message>
943
944       ·   fuller
945
946               commit <sha1>
947               Author:     <author>
948               AuthorDate: <author date>
949               Commit:     <committer>
950               CommitDate: <committer date>
951
952               <title line>
953
954               <full commit message>
955
956       ·   email
957
958               From <sha1> <date>
959               From: <author>
960               Date: <author date>
961               Subject: [PATCH] <title line>
962
963               <full commit message>
964
965       ·   raw
966
967           The raw format shows the entire commit exactly as stored in the
968           commit object. Notably, the SHA-1s are displayed in full,
969           regardless of whether --abbrev or --no-abbrev are used, and parents
970           information show the true parent commits, without taking grafts or
971           history simplification into account. Note that this format affects
972           the way commits are displayed, but not the way the diff is shown
973           e.g. with git log --raw. To get full object names in a raw diff
974           format, use --no-abbrev.
975
976       ·   format:<string>
977
978           The format:<string> format allows you to specify which information
979           you want to show. It works a little bit like printf format, with
980           the notable exception that you get a newline with %n instead of \n.
981
982           E.g, format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"
983           would show something like this:
984
985               The author of fe6e0ee was Junio C Hamano, 23 hours ago
986               The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<
987
988           The placeholders are:
989
990           ·   %H: commit hash
991
992           ·   %h: abbreviated commit hash
993
994           ·   %T: tree hash
995
996           ·   %t: abbreviated tree hash
997
998           ·   %P: parent hashes
999
1000           ·   %p: abbreviated parent hashes
1001
1002           ·   %an: author name
1003
1004           ·   %aN: author name (respecting .mailmap, see git-shortlog(1) or
1005               git-blame(1))
1006
1007           ·   %ae: author email
1008
1009           ·   %aE: author email (respecting .mailmap, see git-shortlog(1) or
1010               git-blame(1))
1011
1012           ·   %ad: author date (format respects --date= option)
1013
1014           ·   %aD: author date, RFC2822 style
1015
1016           ·   %ar: author date, relative
1017
1018           ·   %at: author date, UNIX timestamp
1019
1020           ·   %ai: author date, ISO 8601-like format
1021
1022           ·   %aI: author date, strict ISO 8601 format
1023
1024           ·   %cn: committer name
1025
1026           ·   %cN: committer name (respecting .mailmap, see git-shortlog(1)
1027               or git-blame(1))
1028
1029           ·   %ce: committer email
1030
1031           ·   %cE: committer email (respecting .mailmap, see git-shortlog(1)
1032               or git-blame(1))
1033
1034           ·   %cd: committer date (format respects --date= option)
1035
1036           ·   %cD: committer date, RFC2822 style
1037
1038           ·   %cr: committer date, relative
1039
1040           ·   %ct: committer date, UNIX timestamp
1041
1042           ·   %ci: committer date, ISO 8601-like format
1043
1044           ·   %cI: committer date, strict ISO 8601 format
1045
1046           ·   %d: ref names, like the --decorate option of git-log(1)
1047
1048           ·   %D: ref names without the " (", ")" wrapping.
1049
1050           ·   %e: encoding
1051
1052           ·   %s: subject
1053
1054           ·   %f: sanitized subject line, suitable for a filename
1055
1056           ·   %b: body
1057
1058           ·   %B: raw body (unwrapped subject and body)
1059
1060           ·   %N: commit notes
1061
1062           ·   %GG: raw verification message from GPG for a signed commit
1063
1064           ·   %G?: show "G" for a good (valid) signature, "B" for a bad
1065               signature, "U" for a good signature with unknown validity, "X"
1066               for a good signature that has expired, "Y" for a good signature
1067               made by an expired key, "R" for a good signature made by a
1068               revoked key, "E" if the signature cannot be checked (e.g.
1069               missing key) and "N" for no signature
1070
1071           ·   %GS: show the name of the signer for a signed commit
1072
1073           ·   %GK: show the key used to sign a signed commit
1074
1075           ·   %GF: show the fingerprint of the key used to sign a signed
1076               commit
1077
1078           ·   %GP: show the fingerprint of the primary key whose subkey was
1079               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           blocks
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. Adjacent blocks cannot be
1433               told apart.
1434
1435           zebra
1436               Blocks of moved text are detected as in blocks mode. The blocks
1437               are painted using either the color.diff.{old,new}Moved color or
1438               color.diff.{old,new}MovedAlternative. The change between the
1439               two colors indicates that a new block was detected.
1440
1441           dimmed-zebra
1442               Similar to zebra, but additional dimming of uninteresting parts
1443               of moved code is performed. The bordering lines of two adjacent
1444               blocks are considered interesting, the rest is uninteresting.
1445               dimmed_zebra is a deprecated synonym.
1446
1447       --color-moved-ws=<modes>
1448           This configures how white spaces are ignored when performing the
1449           move detection for --color-moved. These modes can be given as a
1450           comma separated list:
1451
1452           ignore-space-at-eol
1453               Ignore changes in whitespace at EOL.
1454
1455           ignore-space-change
1456               Ignore changes in amount of whitespace. This ignores whitespace
1457               at line end, and considers all other sequences of one or more
1458               whitespace characters to be equivalent.
1459
1460           ignore-all-space
1461               Ignore whitespace when comparing lines. This ignores
1462               differences even if one line has whitespace where the other
1463               line has none.
1464
1465           allow-indentation-change
1466               Initially ignore any white spaces in the move detection, then
1467               group the moved code blocks only into a block if the change in
1468               whitespace is the same per line. This is incompatible with the
1469               other modes.
1470
1471       --word-diff[=<mode>]
1472           Show a word diff, using the <mode> to delimit changed words. By
1473           default, words are delimited by whitespace; see --word-diff-regex
1474           below. The <mode> defaults to plain, and must be one of:
1475
1476           color
1477               Highlight changed words using only colors. Implies --color.
1478
1479           plain
1480               Show words as [-removed-] and {+added+}. Makes no attempts to
1481               escape the delimiters if they appear in the input, so the
1482               output may be ambiguous.
1483
1484           porcelain
1485               Use a special line-based format intended for script
1486               consumption. Added/removed/unchanged runs are printed in the
1487               usual unified diff format, starting with a +/-/` ` character at
1488               the beginning of the line and extending to the end of the line.
1489               Newlines in the input are represented by a tilde ~ on a line of
1490               its own.
1491
1492           none
1493               Disable word diff again.
1494
1495           Note that despite the name of the first mode, color is used to
1496           highlight the changed parts in all modes if enabled.
1497
1498       --word-diff-regex=<regex>
1499           Use <regex> to decide what a word is, instead of considering runs
1500           of non-whitespace to be a word. Also implies --word-diff unless it
1501           was already enabled.
1502
1503           Every non-overlapping match of the <regex> is considered a word.
1504           Anything between these matches is considered whitespace and
1505           ignored(!) for the purposes of finding differences. You may want to
1506           append |[^[:space:]] to your regular expression to make sure that
1507           it matches all non-whitespace characters. A match that contains a
1508           newline is silently truncated(!) at the newline.
1509
1510           For example, --word-diff-regex=.  will treat each character as a
1511           word and, correspondingly, show differences character by character.
1512
1513           The regex can also be set via a diff driver or configuration
1514           option, see gitattributes(5) or git-config(1). Giving it explicitly
1515           overrides any diff driver or configuration setting. Diff drivers
1516           override configuration settings.
1517
1518       --color-words[=<regex>]
1519           Equivalent to --word-diff=color plus (if a regex was specified)
1520           --word-diff-regex=<regex>.
1521
1522       --no-renames
1523           Turn off rename detection, even when the configuration file gives
1524           the default to do so.
1525
1526       --check
1527           Warn if changes introduce conflict markers or whitespace errors.
1528           What are considered whitespace errors is controlled by
1529           core.whitespace configuration. By default, trailing whitespaces
1530           (including lines that consist solely of whitespaces) and a space
1531           character that is immediately followed by a tab character inside
1532           the initial indent of the line are considered whitespace errors.
1533           Exits with non-zero status if problems are found. Not compatible
1534           with --exit-code.
1535
1536       --ws-error-highlight=<kind>
1537           Highlight whitespace errors in the context, old or new lines of the
1538           diff. Multiple values are separated by comma, none resets previous
1539           values, default reset the list to new and all is a shorthand for
1540           old,new,context. When this option is not given, and the
1541           configuration variable diff.wsErrorHighlight is not set, only
1542           whitespace errors in new lines are highlighted. The whitespace
1543           errors are colored with color.diff.whitespace.
1544
1545       --full-index
1546           Instead of the first handful of characters, show the full pre- and
1547           post-image blob object names on the "index" line when generating
1548           patch format output.
1549
1550       --binary
1551           In addition to --full-index, output a binary diff that can be
1552           applied with git-apply.
1553
1554       --abbrev[=<n>]
1555           Instead of showing the full 40-byte hexadecimal object name in
1556           diff-raw format output and diff-tree header lines, show only a
1557           partial prefix. This is independent of the --full-index option
1558           above, which controls the diff-patch output format. Non default
1559           number of digits can be specified with --abbrev=<n>.
1560
1561       -B[<n>][/<m>], --break-rewrites[=[<n>][/<m>]]
1562           Break complete rewrite changes into pairs of delete and create.
1563           This serves two purposes:
1564
1565           It affects the way a change that amounts to a total rewrite of a
1566           file not as a series of deletion and insertion mixed together with
1567           a very few lines that happen to match textually as the context, but
1568           as a single deletion of everything old followed by a single
1569           insertion of everything new, and the number m controls this aspect
1570           of the -B option (defaults to 60%).  -B/70% specifies that less
1571           than 30% of the original should remain in the result for Git to
1572           consider it a total rewrite (i.e. otherwise the resulting patch
1573           will be a series of deletion and insertion mixed together with
1574           context lines).
1575
1576           When used with -M, a totally-rewritten file is also considered as
1577           the source of a rename (usually -M only considers a file that
1578           disappeared as the source of a rename), and the number n controls
1579           this aspect of the -B option (defaults to 50%).  -B20% specifies
1580           that a change with addition and deletion compared to 20% or more of
1581           the file’s size are eligible for being picked up as a possible
1582           source of a rename to another file.
1583
1584       -M[<n>], --find-renames[=<n>]
1585           If generating diffs, detect and report renames for each commit. For
1586           following files across renames while traversing history, see
1587           --follow. If n is specified, it is a threshold on the similarity
1588           index (i.e. amount of addition/deletions compared to the file’s
1589           size). For example, -M90% means Git should consider a delete/add
1590           pair to be a rename if more than 90% of the file hasn’t changed.
1591           Without a % sign, the number is to be read as a fraction, with a
1592           decimal point before it. I.e., -M5 becomes 0.5, and is thus the
1593           same as -M50%. Similarly, -M05 is the same as -M5%. To limit
1594           detection to exact renames, use -M100%. The default similarity
1595           index is 50%.
1596
1597       -C[<n>], --find-copies[=<n>]
1598           Detect copies as well as renames. See also --find-copies-harder. If
1599           n is specified, it has the same meaning as for -M<n>.
1600
1601       --find-copies-harder
1602           For performance reasons, by default, -C option finds copies only if
1603           the original file of the copy was modified in the same changeset.
1604           This flag makes the command inspect unmodified files as candidates
1605           for the source of copy. This is a very expensive operation for
1606           large projects, so use it with caution. Giving more than one -C
1607           option has the same effect.
1608
1609       -D, --irreversible-delete
1610           Omit the preimage for deletes, i.e. print only the header but not
1611           the diff between the preimage and /dev/null. The resulting patch is
1612           not meant to be applied with patch or git apply; this is solely for
1613           people who want to just concentrate on reviewing the text after the
1614           change. In addition, the output obviously lacks enough information
1615           to apply such a patch in reverse, even manually, hence the name of
1616           the option.
1617
1618           When used together with -B, omit also the preimage in the deletion
1619           part of a delete/create pair.
1620
1621       -l<num>
1622           The -M and -C options require O(n^2) processing time where n is the
1623           number of potential rename/copy targets. This option prevents
1624           rename/copy detection from running if the number of rename/copy
1625           targets exceeds the specified number.
1626
1627       --diff-filter=[(A|C|D|M|R|T|U|X|B)...[*]]
1628           Select only files that are Added (A), Copied (C), Deleted (D),
1629           Modified (M), Renamed (R), have their type (i.e. regular file,
1630           symlink, submodule, ...) changed (T), are Unmerged (U), are Unknown
1631           (X), or have had their pairing Broken (B). Any combination of the
1632           filter characters (including none) can be used. When *
1633           (All-or-none) is added to the combination, all paths are selected
1634           if there is any file that matches other criteria in the comparison;
1635           if there is no file that matches other criteria, nothing is
1636           selected.
1637
1638           Also, these upper-case letters can be downcased to exclude. E.g.
1639           --diff-filter=ad excludes added and deleted paths.
1640
1641           Note that not all diffs can feature all types. For instance, diffs
1642           from the index to the working tree can never have Added entries
1643           (because the set of paths included in the diff is limited by what
1644           is in the index). Similarly, copied and renamed entries cannot
1645           appear if detection for those types is disabled.
1646
1647       -S<string>
1648           Look for differences that change the number of occurrences of the
1649           specified string (i.e. addition/deletion) in a file. Intended for
1650           the scripter’s use.
1651
1652           It is useful when you’re looking for an exact block of code (like a
1653           struct), and want to know the history of that block since it first
1654           came into being: use the feature iteratively to feed the
1655           interesting block in the preimage back into -S, and keep going
1656           until you get the very first version of the block.
1657
1658       -G<regex>
1659           Look for differences whose patch text contains added/removed lines
1660           that match <regex>.
1661
1662           To illustrate the difference between -S<regex> --pickaxe-regex and
1663           -G<regex>, consider a commit with the following diff in the same
1664           file:
1665
1666               +    return !regexec(regexp, two->ptr, 1, &regmatch, 0);
1667               ...
1668               -    hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);
1669
1670           While git log -G"regexec\(regexp" will show this commit, git log
1671           -S"regexec\(regexp" --pickaxe-regex will not (because the number of
1672           occurrences of that string did not change).
1673
1674           See the pickaxe entry in gitdiffcore(7) for more information.
1675
1676       --find-object=<object-id>
1677           Look for differences that change the number of occurrences of the
1678           specified object. Similar to -S, just the argument is different in
1679           that it doesn’t search for a specific string but for a specific
1680           object id.
1681
1682           The object can be a blob or a submodule commit. It implies the -t
1683           option in git-log to also find trees.
1684
1685       --pickaxe-all
1686           When -S or -G finds a change, show all the changes in that
1687           changeset, not just the files that contain the change in <string>.
1688
1689       --pickaxe-regex
1690           Treat the <string> given to -S as an extended POSIX regular
1691           expression to match.
1692
1693       -O<orderfile>
1694           Control the order in which files appear in the output. This
1695           overrides the diff.orderFile configuration variable (see git-
1696           config(1)). To cancel diff.orderFile, use -O/dev/null.
1697
1698           The output order is determined by the order of glob patterns in
1699           <orderfile>. All files with pathnames that match the first pattern
1700           are output first, all files with pathnames that match the second
1701           pattern (but not the first) are output next, and so on. All files
1702           with pathnames that do not match any pattern are output last, as if
1703           there was an implicit match-all pattern at the end of the file. If
1704           multiple pathnames have the same rank (they match the same pattern
1705           but no earlier patterns), their output order relative to each other
1706           is the normal order.
1707
1708           <orderfile> is parsed as follows:
1709
1710           ·   Blank lines are ignored, so they can be used as separators for
1711               readability.
1712
1713           ·   Lines starting with a hash ("#") are ignored, so they can be
1714               used for comments. Add a backslash ("\") to the beginning of
1715               the pattern if it starts with a hash.
1716
1717           ·   Each other line contains a single pattern.
1718
1719           Patterns have the same syntax and semantics as patterns used for
1720           fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
1721           matches a pattern if removing any number of the final pathname
1722           components matches the pattern. For example, the pattern "foo*bar"
1723           matches "fooasdfbar" and "foo/bar/baz/asdf" but not "foobarx".
1724
1725       -R
1726           Swap two inputs; that is, show differences from index or on-disk
1727           file to tree contents.
1728
1729       --relative[=<path>]
1730           When run from a subdirectory of the project, it can be told to
1731           exclude changes outside the directory and show pathnames relative
1732           to it with this option. When you are not in a subdirectory (e.g. in
1733           a bare repository), you can name which subdirectory to make the
1734           output relative to by giving a <path> as an argument.
1735
1736       -a, --text
1737           Treat all files as text.
1738
1739       --ignore-cr-at-eol
1740           Ignore carriage-return at the end of line when doing a comparison.
1741
1742       --ignore-space-at-eol
1743           Ignore changes in whitespace at EOL.
1744
1745       -b, --ignore-space-change
1746           Ignore changes in amount of whitespace. This ignores whitespace at
1747           line end, and considers all other sequences of one or more
1748           whitespace characters to be equivalent.
1749
1750       -w, --ignore-all-space
1751           Ignore whitespace when comparing lines. This ignores differences
1752           even if one line has whitespace where the other line has none.
1753
1754       --ignore-blank-lines
1755           Ignore changes whose lines are all blank.
1756
1757       --inter-hunk-context=<lines>
1758           Show the context between diff hunks, up to the specified number of
1759           lines, thereby fusing hunks that are close to each other. Defaults
1760           to diff.interHunkContext or 0 if the config option is unset.
1761
1762       -W, --function-context
1763           Show whole surrounding functions of changes.
1764
1765       --ext-diff
1766           Allow an external diff helper to be executed. If you set an
1767           external diff driver with gitattributes(5), you need to use this
1768           option with git-log(1) and friends.
1769
1770       --no-ext-diff
1771           Disallow external diff drivers.
1772
1773       --textconv, --no-textconv
1774           Allow (or disallow) external text conversion filters to be run when
1775           comparing binary files. See gitattributes(5) for details. Because
1776           textconv filters are typically a one-way conversion, the resulting
1777           diff is suitable for human consumption, but cannot be applied. For
1778           this reason, textconv filters are enabled by default only for git-
1779           diff(1) and git-log(1), but not for git-format-patch(1) or diff
1780           plumbing commands.
1781
1782       --ignore-submodules[=<when>]
1783           Ignore changes to submodules in the diff generation. <when> can be
1784           either "none", "untracked", "dirty" or "all", which is the default.
1785           Using "none" will consider the submodule modified when it either
1786           contains untracked or modified files or its HEAD differs from the
1787           commit recorded in the superproject and can be used to override any
1788           settings of the ignore option in git-config(1) or gitmodules(5).
1789           When "untracked" is used submodules are not considered dirty when
1790           they only contain untracked content (but they are still scanned for
1791           modified content). Using "dirty" ignores all changes to the work
1792           tree of submodules, only changes to the commits stored in the
1793           superproject are shown (this was the behavior until 1.7.0). Using
1794           "all" hides all changes to submodules.
1795
1796       --src-prefix=<prefix>
1797           Show the given source prefix instead of "a/".
1798
1799       --dst-prefix=<prefix>
1800           Show the given destination prefix instead of "b/".
1801
1802       --no-prefix
1803           Do not show any source or destination prefix.
1804
1805       --line-prefix=<prefix>
1806           Prepend an additional prefix to every line of output.
1807
1808       --ita-invisible-in-index
1809           By default entries added by "git add -N" appear as an existing
1810           empty file in "git diff" and a new file in "git diff --cached".
1811           This option makes the entry appear as a new file in "git diff" and
1812           non-existent in "git diff --cached". This option could be reverted
1813           with --ita-visible-in-index. Both options are experimental and
1814           could be removed in future.
1815
1816       For more detailed explanation on these common options, see also
1817       gitdiffcore(7).
1818

GENERATING PATCHES WITH -P

1820       When "git-diff-index", "git-diff-tree", or "git-diff-files" are run
1821       with a -p option, "git diff" without the --raw option, or "git log"
1822       with the "-p" option, they do not produce the output described above;
1823       instead they produce a patch file. You can customize the creation of
1824       such patches via the GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS
1825       environment variables.
1826
1827       What the -p option produces is slightly different from the traditional
1828       diff format:
1829
1830        1. It is preceded with a "git diff" header that looks like this:
1831
1832               diff --git a/file1 b/file2
1833
1834           The a/ and b/ filenames are the same unless rename/copy is
1835           involved. Especially, even for a creation or a deletion, /dev/null
1836           is not used in place of the a/ or b/ filenames.
1837
1838           When rename/copy is involved, file1 and file2 show the name of the
1839           source file of the rename/copy and the name of the file that
1840           rename/copy produces, respectively.
1841
1842        2. It is followed by one or more extended header lines:
1843
1844               old mode <mode>
1845               new mode <mode>
1846               deleted file mode <mode>
1847               new file mode <mode>
1848               copy from <path>
1849               copy to <path>
1850               rename from <path>
1851               rename to <path>
1852               similarity index <number>
1853               dissimilarity index <number>
1854               index <hash>..<hash> <mode>
1855
1856           File modes are printed as 6-digit octal numbers including the file
1857           type and file permission bits.
1858
1859           Path names in extended headers do not include the a/ and b/
1860           prefixes.
1861
1862           The similarity index is the percentage of unchanged lines, and the
1863           dissimilarity index is the percentage of changed lines. It is a
1864           rounded down integer, followed by a percent sign. The similarity
1865           index value of 100% is thus reserved for two equal files, while
1866           100% dissimilarity means that no line from the old file made it
1867           into the new one.
1868
1869           The index line includes the SHA-1 checksum before and after the
1870           change. The <mode> is included if the file mode does not change;
1871           otherwise, separate lines indicate the old and the new mode.
1872
1873        3. Pathnames with "unusual" characters are quoted as explained for the
1874           configuration variable core.quotePath (see git-config(1)).
1875
1876        4. All the file1 files in the output refer to files before the commit,
1877           and all the file2 files refer to files after the commit. It is
1878           incorrect to apply each change to each file sequentially. For
1879           example, this patch will swap a and b:
1880
1881               diff --git a/a b/b
1882               rename from a
1883               rename to b
1884               diff --git a/b b/a
1885               rename from b
1886               rename to a
1887

COMBINED DIFF FORMAT

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

EXAMPLES

1995       git log --no-merges
1996           Show the whole commit history, but skip any merges
1997
1998       git log v2.6.12.. include/scsi drivers/scsi
1999           Show all commits since version v2.6.12 that changed any file in the
2000           include/scsi or drivers/scsi subdirectories
2001
2002       git log --since="2 weeks ago" -- gitk
2003           Show the changes during the last two weeks to the file gitk. The --
2004           is necessary to avoid confusion with the branch named gitk
2005
2006       git log --name-status release..test
2007           Show the commits that are in the "test" branch but not yet in the
2008           "release" branch, along with the list of paths each commit
2009           modifies.
2010
2011       git log --follow builtin/rev-list.c
2012           Shows the commits that changed builtin/rev-list.c, including those
2013           commits that occurred before the file was given its present name.
2014
2015       git log --branches --not --remotes=origin
2016           Shows all commits that are in any of local branches but not in any
2017           of remote-tracking branches for origin (what you have that origin
2018           doesn’t).
2019
2020       git log master --not --remotes=*/master
2021           Shows all commits that are in local master but not in any remote
2022           repository master branches.
2023
2024       git log -p -m --first-parent
2025           Shows the history including change diffs, but only from the “main
2026           branch” perspective, skipping commits that come from merged
2027           branches, and showing full diffs of changes introduced by the
2028           merges. This makes sense only when following a strict policy of
2029           merging all topic branches when staying on a single integration
2030           branch.
2031
2032       git log -L '/int main/',/^}/:main.c
2033           Shows how the function main() in the file main.c evolved over time.
2034
2035       git log -3
2036           Limits the number of commits to show to 3.
2037

DISCUSSION

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

CONFIGURATION

2102       See git-config(1) for core variables and git-diff(1) for settings
2103       related to diff generation.
2104
2105       format.pretty
2106           Default for the --format option. (See Pretty Formats above.)
2107           Defaults to medium.
2108
2109       i18n.logOutputEncoding
2110           Encoding to use when displaying logs. (See Discussion above.)
2111           Defaults to the value of i18n.commitEncoding if set, and UTF-8
2112           otherwise.
2113
2114       log.date
2115           Default format for human-readable dates. (Compare the --date
2116           option.) Defaults to "default", which means to write dates like Sat
2117           May 8 19:35:34 2010 -0500.
2118
2119       log.follow
2120           If true, git log will act as if the --follow option was used when a
2121           single <path> is given. This has the same limitations as --follow,
2122           i.e. it cannot be used to follow multiple files and does not work
2123           well on non-linear history.
2124
2125       log.showRoot
2126           If false, git log and related commands will not treat the initial
2127           commit as a big creation event. Any root commits in git log -p
2128           output would be shown without a diff attached. The default is true.
2129
2130       log.showSignature
2131           If true, git log and related commands will act as if the
2132           --show-signature option was passed to them.
2133
2134       mailmap.*
2135           See git-shortlog(1).
2136
2137       notes.displayRef
2138           Which refs, in addition to the default set by core.notesRef or
2139           GIT_NOTES_REF, to read notes from when showing commit messages with
2140           the log family of commands. See git-notes(1).
2141
2142           May be an unabbreviated ref name or a glob and may be specified
2143           multiple times. A warning will be issued for refs that do not
2144           exist, but a glob that does not match any refs is silently ignored.
2145
2146           This setting can be disabled by the --no-notes option, overridden
2147           by the GIT_NOTES_DISPLAY_REF environment variable, and overridden
2148           by the --notes=<ref> option.
2149

GIT

2151       Part of the git(1) suite
2152
2153
2154
2155Git 2.20.1                        12/15/2018                        GIT-LOG(1)
Impressum