3 .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
7 .\" Source: Git 2.47.0.rc0
10 .TH "GIT\-LOG" "1" "2024-09-25" "Git 2\&.47\&.0\&.rc0" "Git Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
25 .\" disable justification (adjust text to left margin only)
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
31 git-log \- Show commit logs
35 \fIgit log\fR [<options>] [<revision\-range>] [[\-\-] <path>\&...\:]
39 Shows the commit logs\&.
41 List commits that are reachable by following the \fBparent\fR links from the given commit(s), but exclude commits that are reachable from the one(s) given with a \fI^\fR in front of them\&. The output is given in reverse chronological order by default\&.
43 You can think of this as a set operation\&. Commits reachable from any of the commits given on the command line form a set, and then commits reachable from any of the ones given with \fI^\fR in front are subtracted from that set\&. The remaining commits are what comes out in the command\(cqs output\&. Various other options and paths parameters can be used to further limit the result\&.
45 Thus, the following command:
51 $ git log foo bar ^baz
57 means "list all the commits which are reachable from \fIfoo\fR or \fIbar\fR, but not from \fIbaz\fR"\&.
59 A special notation "\fI<commit1>\fR\&.\&.\fI<commit2>\fR" can be used as a short\-hand for "^\fI<commit1>\fR \fI<commit2>\fR"\&. For example, either of the following may be used interchangeably:
65 $ git log origin\&.\&.HEAD
66 $ git log HEAD ^origin
72 Another special notation is "\fI<commit1>\fR\&...\:\fI<commit2>\fR" which is useful for merges\&. The resulting set of commits is the symmetric difference between the two operands\&. The following two commands are equivalent:
78 $ git log A B \-\-not $(git merge\-base \-\-all A B)
85 The command takes options applicable to the \fBgit-rev-list\fR(1) command to control what is shown and how, and options applicable to the \fBgit-diff\fR(1) command to control how the changes each commit introduces are shown\&.
90 Continue listing the history of a file beyond renames (works only for a single file)\&.
93 \-\-no\-decorate, \-\-decorate[=short|full|auto|no]
95 Print out the ref names of any commits that are shown\&. If
97 is specified, the ref name prefixes
102 will not be printed\&. If
104 is specified, the full ref name (including prefix) will be printed\&. If
106 is specified, then if the output is going to a terminal, the ref names are shown as if
108 were given, otherwise no ref names are shown\&. The option
111 \fB\-\-decorate=short\fR\&. Default to configuration value of
113 if configured, otherwise,
117 \-\-decorate\-refs=<pattern>, \-\-decorate\-refs\-exclude=<pattern>
119 For each candidate reference, do not use it for decoration if it matches any patterns given to
120 \fB\-\-decorate\-refs\-exclude\fR
121 or if it doesn\(cqt match any of the patterns given to
122 \fB\-\-decorate\-refs\fR\&. The
123 \fBlog\&.excludeDecoration\fR
124 config option allows excluding refs from the decorations, but an explicit
125 \fB\-\-decorate\-refs\fR
126 pattern will override a match in
127 \fBlog\&.excludeDecoration\fR\&.
129 If none of these options or config settings are given, then references are used as decoration if they match
133 \fBrefs/stash/\fR, or
137 \-\-clear\-decorations
139 When specified, this option clears all previous
140 \fB\-\-decorate\-refs\fR
142 \fB\-\-decorate\-refs\-exclude\fR
143 options and relaxes the default decoration filter to include all references\&. This option is assumed if the config value
144 \fBlog\&.initialDecorationSet\fR
151 Print out the ref name given on the command line by which each commit was reached\&.
154 \-\-[no\-]mailmap, \-\-[no\-]use\-mailmap
156 Use mailmap file to map author and committer names and email addresses to canonical real names and email addresses\&. See
157 \fBgit-shortlog\fR(1)\&.
163 \fBgit log \-p <path>\&.\&.\&.\fR
164 shows commits that touch the specified paths, and diffs about the same specified paths\&. With this, the full diff is shown for commits that touch the specified paths; this means that "<path>\&...\:" limits only commits, and doesn\(cqt limit diff for those commits\&.
166 Note that this affects all diff\-based output types, e\&.g\&. those produced by
167 \fB\-\-stat\fR, etc\&.
173 \(lqlog size <number>\(rq
174 in the output for each commit, where <number> is the length of that commit\(cqs message in bytes\&. Intended to speed up tools that read log messages from
176 output by allowing them to allocate space in advance\&.
179 \-L<start>,<end>:<file>, \-L:<funcname>:<file>
181 Trace the evolution of the line range given by
182 \fI<start>,<end>\fR, or by the function name regex
183 \fI<funcname>\fR, within the
184 \fI<file>\fR\&. You may not give any pathspec limiters\&. This is currently limited to a walk starting from a single revision, i\&.e\&., you may only give zero or one positive revision arguments, and
189 \fI<funcname>\fR) must exist in the starting revision\&. You can specify this option more than once\&. Implies
190 \fB\-\-patch\fR\&. Patch output can be suppressed using
191 \fB\-\-no\-patch\fR, but other diff formats (namely
197 \fB\-\-name\-only\fR,
198 \fB\-\-name\-status\fR,
199 \fB\-\-check\fR) are not currently implemented\&.
204 can take one of these forms:
220 is a number, it specifies an absolute line number (lines count from 1)\&.
233 This form will use the first line matching the given POSIX regex\&. If
235 is a regex, it will search from the end of the previous
237 range, if any, otherwise from the start of file\&. If
240 \fB^/regex/\fR, it will search from the start of file\&. If
242 is a regex, it will search starting at the line given by
256 This is only valid for
258 and will specify a number of lines before or after the line given by
267 \fI<end>\fR, it is a regular expression that denotes the range from the first funcname line that matches
268 \fI<funcname>\fR, up to the next funcname line\&.
270 searches from the end of the previous
272 range, if any, otherwise from the start of file\&.
274 searches from the start of file\&. The function names are determined in the same way as
276 works out patch hunk headers (see
277 \fIDefining a custom hunk\-header\fR
279 \fBgitattributes\fR(5))\&.
284 Show only commits in the specified revision range\&. When no <revision\-range> is specified, it defaults to
286 (i\&.e\&. the whole history leading to the current commit)\&.
287 \fBorigin\&.\&.HEAD\fR
288 specifies all the commits reachable from the current commit (i\&.e\&.
289 \fBHEAD\fR), but not from
290 \fBorigin\fR\&. For a complete list of ways to spell <revision\-range>, see the
291 \fISpecifying Ranges\fR
293 \fBgitrevisions\fR(7)\&.
298 Show only commits that are enough to explain how the files that match the specified paths came to be\&. See
299 \fIHistory Simplification\fR
300 below for details and other simplification modes\&.
302 Paths may need to be prefixed with
304 to separate them from options or the revision range, when confusion arises\&.
306 .SS "Commit Limiting"
308 Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
310 Using more options generally further limits the output (e\&.g\&. \fB\-\-since=<date1>\fR limits to commits newer than \fB<date1>\fR, and using it with \fB\-\-grep=<pattern>\fR further limits to commits whose log message has a line that matches \fB<pattern>\fR), unless otherwise noted\&.
312 Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
314 \-<number>, \-n <number>, \-\-max\-count=<number>
316 Limit the number of commits to output\&.
323 commits before starting to show the commit output\&.
326 \-\-since=<date>, \-\-after=<date>
328 Show commits more recent than a specific date\&.
331 \-\-since\-as\-filter=<date>
333 Show all commits more recent than a specific date\&. This visits all commits in the range, rather than stopping at the first commit which is older than a specific date\&.
336 \-\-until=<date>, \-\-before=<date>
338 Show commits older than a specific date\&.
341 \-\-author=<pattern>, \-\-committer=<pattern>
343 Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
344 \fB\-\-author=<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
345 \fB\-\-committer=<pattern>\fR)\&.
348 \-\-grep\-reflog=<pattern>
350 Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
351 \fB\-\-grep\-reflog\fR, commits whose reflog message matches any of the given patterns are chosen\&. It is an error to use this option unless
352 \fB\-\-walk\-reflogs\fR
358 Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
359 \fB\-\-grep=<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
360 \fB\-\-all\-match\fR)\&.
364 is in effect, the message from the notes is matched as if it were part of the log message\&.
369 Limit the commits output to ones that match all given
370 \fB\-\-grep\fR, instead of ones that match at least one\&.
375 Limit the commits output to ones with a log message that do not match the pattern specified with
376 \fB\-\-grep=<pattern>\fR\&.
379 \-i, \-\-regexp\-ignore\-case
381 Match the regular expression limiting patterns without regard to letter case\&.
386 Consider the limiting patterns to be basic regular expressions; this is the default\&.
389 \-E, \-\-extended\-regexp
391 Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
394 \-F, \-\-fixed\-strings
396 Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
399 \-P, \-\-perl\-regexp
401 Consider the limiting patterns to be Perl\-compatible regular expressions\&.
403 Support for these types of regular expressions is an optional compile\-time dependency\&. If Git wasn\(cqt compiled with support for them providing this option will cause it to die\&.
408 Stop when a given path disappears from the tree\&.
413 Print only merge commits\&. This is exactly the same as
414 \fB\-\-min\-parents=2\fR\&.
419 Do not print commits with more than one parent\&. This is exactly the same as
420 \fB\-\-max\-parents=1\fR\&.
423 \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
425 Show only commits which have at least (or at most) that many parent commits\&. In particular,
426 \fB\-\-max\-parents=1\fR
428 \fB\-\-no\-merges\fR,
429 \fB\-\-min\-parents=2\fR
432 \fB\-\-max\-parents=0\fR
433 gives all root commits and
434 \fB\-\-min\-parents=3\fR
435 all octopus merges\&.
437 \fB\-\-no\-min\-parents\fR
439 \fB\-\-no\-max\-parents\fR
440 reset these limits (to no limit) again\&. Equivalent forms are
441 \fB\-\-min\-parents=0\fR
442 (any commit has 0 or more parents) and
443 \fB\-\-max\-parents=\-1\fR
444 (negative numbers denote no upper limit)\&.
449 When finding commits to include, follow only the first parent commit upon seeing a merge commit\&. This option can give a better overview when viewing the evolution of a particular topic branch, because merges into a topic branch tend to be only about adjusting to updated upstream from time to time, and this option allows you to ignore the individual commits brought in to your history by such a merge\&.
451 This option also changes default diff format for merge commits to
452 \fBfirst\-parent\fR, see
453 \fB\-\-diff\-merges=first\-parent\fR
457 \-\-exclude\-first\-parent\-only
459 When finding commits to exclude (with a
460 \fI^\fR), follow only the first parent commit upon seeing a merge commit\&. This can be used to find the set of changes in a topic branch from the point where it diverged from the remote branch, given that arbitrary merges can be valid topic branch changes\&.
465 Reverses the meaning of the
467 prefix (or lack thereof) for all following revision specifiers, up to the next
468 \fB\-\-not\fR\&. When used on the command line before \-\-stdin, the revisions passed through stdin will not be affected by it\&. Conversely, when passed via standard input, the revisions passed on the command line will not be affected by it\&.
473 Pretend as if all the refs in
474 \fBrefs/\fR, along with
475 \fBHEAD\fR, are listed on the command line as
479 \-\-branches[=<pattern>]
481 Pretend as if all the refs in
483 are listed on the command line as
486 is given, limit branches to ones matching given shell glob\&. If pattern lacks
491 at the end is implied\&.
496 Pretend as if all the refs in
498 are listed on the command line as
501 is given, limit tags to ones matching given shell glob\&. If pattern lacks
506 at the end is implied\&.
509 \-\-remotes[=<pattern>]
511 Pretend as if all the refs in
513 are listed on the command line as
516 is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
521 at the end is implied\&.
524 \-\-glob=<glob\-pattern>
526 Pretend as if all the refs matching shell glob
527 \fI<glob\-pattern>\fR
528 are listed on the command line as
529 \fI<commit>\fR\&. Leading
530 \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
535 at the end is implied\&.
538 \-\-exclude=<glob\-pattern>
540 Do not include refs matching
541 \fI<glob\-pattern>\fR
546 \fB\-\-remotes\fR, or
548 would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
552 \fB\-\-remotes\fR, or
554 option (other options or arguments do not clear accumulated patterns)\&.
556 The patterns given should not begin with
563 \fB\-\-remotes\fR, respectively, and they must begin with
568 \fB\-\-all\fR\&. If a trailing
570 is intended, it must be given explicitly\&.
573 \-\-exclude\-hidden=[fetch|receive|uploadpack]
575 Do not include refs that would be hidden by
577 \fBgit\-receive\-pack\fR
579 \fBgit\-upload\-pack\fR
580 by consulting the appropriate
581 \fBfetch\&.hideRefs\fR,
582 \fBreceive\&.hideRefs\fR
584 \fBuploadpack\&.hideRefs\fR
585 configuration along with
586 \fBtransfer\&.hideRefs\fR
588 \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
592 and is cleared after processing them\&.
597 Pretend as if all objects mentioned by reflogs are listed on the command line as
603 Pretend as if all objects mentioned as ref tips of alternate repositories were listed on the command line\&. An alternate repository is any repository whose object directory is specified in
604 \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
605 \fBcore\&.alternateRefsCommand\fR, etc\&. See
606 \fBgit-config\fR(1)\&.
611 By default, all working trees will be examined by the following options when there are more than one (see
612 \fBgit-worktree\fR(1)):
616 \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
621 Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
626 Pretend as if the bad bisection ref
627 \fBrefs/bisect/bad\fR
628 was listed and as if it was followed by
630 and the good bisection refs
631 \fBrefs/bisect/good\-*\fR
632 on the command line\&.
637 In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
640 \fB\-\-glob=\fR\&. When a
642 separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
644 which are read via standard input are only respected for arguments passed in the same way and will not influence any subsequent command line arguments\&.
650 \fB\-\-cherry\-pick\fR
651 (see below) but mark equivalent commits with
653 rather than omitting them, and inequivalent ones with
659 Omit any commit that introduces the same change as another commit on the
661 when the set of commits are limited with symmetric difference\&.
663 For example, if you have two branches,
666 \fBB\fR, a usual way to list all commits on only one side of them is with
667 \fB\-\-left\-right\fR
668 (see the example below in the description of the
669 \fB\-\-left\-right\fR
670 option)\&. However, it shows the commits that were cherry\-picked from the other branch (for example,
672 may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
675 \-\-left\-only, \-\-right\-only
677 List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked
682 \fB\-\-left\-right\fR\&.
685 \fB\-\-cherry\-pick \-\-right\-only A\&.\&.\&.B\fR
686 omits those commits from
690 or are patch\-equivalent to a commit in
691 \fBA\fR\&. In other words, this lists the
694 \fBgit cherry A B\fR\&. More precisely,
695 \fB\-\-cherry\-pick \-\-right\-only \-\-no\-merges\fR
696 gives the exact list\&.
702 \fB\-\-right\-only \-\-cherry\-mark \-\-no\-merges\fR; useful to limit the output to the commits on our side and mark those that have been applied to the other side of a forked history with
703 \fBgit log \-\-cherry upstream\&.\&.\&.mybranch\fR, similar to
704 \fBgit cherry upstream mybranch\fR\&.
707 \-g, \-\-walk\-reflogs
709 Instead of walking the commit ancestry chain, walk reflog entries from the most recent one to older ones\&. When this option is used you cannot specify commits to exclude (that is,
711 \fIcommit1\&.\&.commit2\fR, and
712 \fIcommit1\&.\&.\&.commit2\fR
713 notations cannot be used)\&.
721 (for obvious reasons), this causes the output to have two extra lines of information taken from the reflog\&. The reflog designator in the output may be shown as
725 is the reverse\-chronological index in the reflog) or as
726 \fBref@{<timestamp>}\fR
729 for that entry), depending on a few rules:
739 If the starting point is specified as
740 \fBref@{<Nth>}\fR, show the index format\&.
751 If the starting point was specified as
752 \fBref@{now}\fR, show the timestamp format\&.
763 If neither was used, but
765 was given on the command line, show the timestamp in the format requested by
777 Otherwise, show the index format\&.
781 \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
782 \fB\-\-reverse\fR\&. See also
783 \fBgit-reflog\fR(1)\&.
786 \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
791 Show commits touching conflicted paths in the range
792 \fBHEAD\&.\&.\&.<other>\fR, where
794 is the first existing pseudoref in
796 \fBCHERRY_PICK_HEAD\fR,
799 \fBREBASE_HEAD\fR\&. Only works when the index has unmerged entries\&. This option can be used to show relevant commits when resolving conflicts from a 3\-way merge\&.
804 Output excluded boundary commits\&. Boundary commits are prefixed with
807 .SS "History Simplification"
809 Sometimes you are only interested in parts of the history, for example the commits modifying a particular <path>\&. But there are two parts of \fIHistory Simplification\fR, one part is selecting the commits and the other is how to do it, as there are various strategies to simplify the history\&.
811 The following options select the commits to be shown:
815 Commits modifying the given <paths> are selected\&.
818 \-\-simplify\-by\-decoration
820 Commits that are referred by some branch or tag are selected\&.
823 Note that extra commits can be shown to give a meaningful history\&.
825 The following options affect the way the simplification is performed:
829 Simplifies the history to the simplest history explaining the final state of the tree\&. Simplest because it prunes some side branches if the end result is the same (i\&.e\&. merging branches with the same content)
834 Include all commits from the default mode, but also any merge commits that are not TREESAME to the first parent but are TREESAME to a later parent\&. This mode is helpful for showing the merge commits that "first introduced" a change to a branch\&.
839 Same as the default mode, but does not prune some history\&.
844 Only the selected commits are shown, plus some to have a meaningful history\&.
849 All commits in the simplified history are shown\&.
855 \fB\-\-full\-history\fR
856 to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
859 \-\-ancestry\-path[=<commit>]
861 When given a range of commits to display (e\&.g\&.
862 \fIcommit1\&.\&.commit2\fR
864 \fIcommit2 ^commit1\fR), only display commits in that range that are ancestors of <commit>, descendants of <commit>, or <commit> itself\&. If no commit is specified, use
866 (the excluded part of the range) as <commit>\&. Can be passed multiple times; if so, a commit is included if it is any of the commits given or if it is an ancestor or descendant of one of them\&.
869 A more detailed explanation follows\&.
871 Suppose you specified \fBfoo\fR as the <paths>\&. We shall call commits that modify \fBfoo\fR !TREESAME, and the rest TREESAME\&. (In a diff filtered for \fBfoo\fR, they look different and equal, respectively\&.)
873 In the following, we will always refer to the same example history to illustrate the differences between simplification settings\&. We assume that you are filtering for a file \fBfoo\fR in this commit graph:
879 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
883 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
889 The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
900 is the initial commit, in which
903 \(lqasdf\(rq, and a file
906 \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
935 contains the same change as
938 is trivial and hence TREESAME to all parents\&.
951 \fBfoo\fR, but its merge
954 \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
969 \(lqbaz\(rq\&. Its merge
971 combines the strings from
976 \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
991 \(lqxyzzy\(rq, and its merge
993 combines the strings to
994 \(lqquux xyzzy\(rq\&.
1003 \h'-04'\(bu\h'+03'\c
1010 is an independent root commit that added a new file
1016 \fBX\fR\&. Its merge
1028 \fBrev\-list\fR walks backwards through history, including or excluding commits based on whether \fB\-\-full\-history\fR and/or parent rewriting (via \fB\-\-parents\fR or \fB\-\-children\fR) are used\&. The following settings are available\&.
1032 Commits are included if they are not TREESAME to any parent (though this can be changed, see
1034 below)\&. If the commit was a merge, and it was TREESAME to one parent, follow only that parent\&. (Even if there are several TREESAME parents, follow only one of them\&.) Otherwise, follow all parents\&.
1042 \&.\-A\-\-\-N\-\-\-O
1044 I\-\-\-\-\-\-\-\-\-D
1050 Note how the rule to only follow the TREESAME parent, if one is available, removed
1052 from consideration entirely\&.
1055 \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
1059 Parent/child relations are only visible with
1060 \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
1063 \-\-full\-history without parent rewriting
1065 This mode differs from the default in one point: always follow all parents of a merge, even if it is TREESAME to one of them\&. Even if more than one side of the merge has commits that are included, this does not imply that the merge itself is! In the example, we get
1078 was excluded because it is TREESAME to both parents\&.
1083 were all walked, but only
1085 was !TREESAME, so the others do not appear\&.
1087 Note that without parent rewriting, it is not really possible to talk about the parent/child relationships between the commits, so we show them disconnected\&.
1090 \-\-full\-history with parent rewriting
1092 Ordinary commits are only included if they are !TREESAME (though this can be changed, see
1096 Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
1102 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
1106 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
1113 \fB\-\-full\-history\fR
1114 without rewriting above\&. Note that
1116 was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
1117 \fBE\fR\*(Aqs parent
1118 \fBI\fR\&. The same happened for
1128 In addition to the above settings, you can change whether TREESAME affects inclusion:
1132 Commits that are walked are included if they are not TREESAME to any parent\&.
1137 All commits that are walked are included\&.
1140 \fB\-\-full\-history\fR, this still simplifies merges: if one of the parents is TREESAME, we follow only that one, so the other sides of the merge are never walked\&.
1143 \-\-simplify\-merges
1145 First, build a history graph in the same way that
1146 \fB\-\-full\-history\fR
1147 with parent rewriting does (see above)\&.
1149 Then simplify each commit
1153 in the final history according to the following rules:
1157 \h'-04'\(bu\h'+03'\c
1171 \h'-04'\(bu\h'+03'\c
1181 with its simplification
1182 \fBP\*(Aq\fR\&. In the process, drop parents that are ancestors of other parents or that are root commits TREESAME to an empty tree, and remove duplicates, but take care to never drop all parents that we are TREESAME to\&.
1187 \h'-04'\(bu\h'+03'\c
1193 If after this parent rewriting,
1195 is a root or merge commit (has zero or >1 parents), a boundary commit, or !TREESAME, it remains\&. Otherwise, it is replaced with its only parent\&.
1198 The effect of this is best shown by way of comparing to
1199 \fB\-\-full\-history\fR
1200 with parent rewriting\&. The example turns into:
1206 \&.\-A\-\-\-M\-\-\-N\-\-\-O
1210 `\-\-\-\-\-\-\-\-\-\*(Aq
1216 Note the major differences in
1221 \fB\-\-full\-history\fR:
1225 \h'-04'\(bu\h'+03'\c
1231 \fBN\fR\*(Aqs parent list had
1233 removed, because it is an ancestor of the other parent
1236 remained because it is !TREESAME\&.
1241 \h'-04'\(bu\h'+03'\c
1247 \fBP\fR\*(Aqs parent list similarly had
1251 was then removed completely, because it had one parent and is TREESAME\&.
1256 \h'-04'\(bu\h'+03'\c
1262 \fBQ\fR\*(Aqs parent list had
1267 was then removed, because it was a TREESAME root\&.
1269 was then removed completely, because it had one parent and is TREESAME\&.
1273 There is another simplification mode available:
1275 \-\-ancestry\-path[=<commit>]
1277 Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
1279 As an example use case, consider the following commit history:
1285 D\-\-\-E\-\-\-\-\-\-\-F
1287 B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
1289 A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1297 computes the set of commits that are ancestors of
1298 \fBM\fR, but excludes the ones that are ancestors of
1299 \fBD\fR\&. This is useful to see what happened to the history leading to
1302 \fBD\fR, in the sense that
1303 \(lqwhat does \fBM\fR have that did not exist in \fBD\fR\(rq\&. The result in this example would be all the commits, except
1309 itself, of course)\&.
1311 When we want to find out what commits in
1313 are contaminated with the bug introduced by
1315 and need fixing, however, we might want to view only the subset of
1317 that are actually descendants of
1318 \fBD\fR, i\&.e\&. excluding
1321 \fBK\fR\&. This is exactly what the
1322 \fB\-\-ancestry\-path\fR
1323 option does\&. Applied to the
1325 range, it results in:
1333 G\-\-\-H\-\-\-I\-\-\-J
1342 \fB\-\-ancestry\-path=D\fR
1344 \fB\-\-ancestry\-path\fR
1345 which means the same thing when applied to the
1347 range but is just more explicit\&.
1349 If we instead are interested in a given topic within this range, and all commits affected by that topic, we may only want to view the subset of
1351 which contain that topic in their ancestry path\&. So, using
1352 \fB\-\-ancestry\-path=H D\&.\&.M\fR
1353 for example would result in:
1361 G\-\-\-H\-\-\-I\-\-\-J
1370 \fB\-\-ancestry\-path=K D\&.\&.M\fR
1377 K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1384 Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
1386 A common problem users face when looking at simplified history is that a commit they know changed a file somehow does not appear in the file\(cqs simplified history\&. Let\(cqs demonstrate a new example and show how options such as \fB\-\-full\-history\fR and \fB\-\-simplify\-merges\fR works in that case:
1392 \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
1394 I B \e R\-\*(Aq`\-Z\*(Aq /
1397 `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
1403 For this example, suppose \fBI\fR created \fBfile\&.txt\fR which was modified by \fBA\fR, \fBB\fR, and \fBX\fR in different ways\&. The single\-parent commits \fBC\fR, \fBZ\fR, and \fBY\fR do not change \fBfile\&.txt\fR\&. The merge commit \fBM\fR was created by resolving the merge conflict to include both changes from \fBA\fR and \fBB\fR and hence is not TREESAME to either\&. The merge commit \fBR\fR, however, was created by ignoring the contents of \fBfile\&.txt\fR at \fBM\fR and taking only the contents of \fBfile\&.txt\fR at \fBX\fR\&. Hence, \fBR\fR is TREESAME to \fBX\fR but not \fBM\fR\&. Finally, the natural merge resolution to create \fBN\fR is to take the contents of \fBfile\&.txt\fR at \fBR\fR, so \fBN\fR is TREESAME to \fBR\fR but not \fBC\fR\&. The merge commits \fBO\fR and \fBP\fR are TREESAME to their first parents, but not to their second parents, \fBZ\fR and \fBY\fR respectively\&.
1405 When using the default mode, \fBN\fR and \fBR\fR both have a TREESAME parent, so those edges are walked and the others are ignored\&. The resulting history graph is:
1417 When using \fB\-\-full\-history\fR, Git walks every edge\&. This will discover the commits \fBA\fR and \fBB\fR and the merge \fBM\fR, but also will reveal the merge commits \fBO\fR and \fBP\fR\&. With parent rewriting, the resulting graph is:
1423 \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
1425 I B \e R\-\*(Aq`\-\-\*(Aq /
1428 `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
1434 Here, the merge commits \fBO\fR and \fBP\fR contribute extra noise, as they did not actually contribute a change to \fBfile\&.txt\fR\&. They only merged a topic that was based on an older version of \fBfile\&.txt\fR\&. This is a common issue in repositories using a workflow where many contributors work in parallel and merge their topic branches along a single trunk: many unrelated merges appear in the \fB\-\-full\-history\fR results\&.
1436 When using the \fB\-\-simplify\-merges\fR option, the commits \fBO\fR and \fBP\fR disappear from the results\&. This is because the rewritten second parents of \fBO\fR and \fBP\fR are reachable from their first parents\&. Those edges are removed and then the commits look like single\-parent commits that are TREESAME to their parent\&. This also happens to the commit \fBN\fR, resulting in a history view as follows:
1442 \&.\-A\-\-\-M\-\-\&.
1453 In this view, we see all of the important single\-parent changes from \fBA\fR, \fBB\fR, and \fBX\fR\&. We also see the carefully\-resolved merge \fBM\fR and the not\-so\-carefully\-resolved merge \fBR\fR\&. This is usually enough information to determine why the commits \fBA\fR and \fBB\fR "disappeared" from history in the default view\&. However, there are a few issues with this approach\&.
1455 The first issue is performance\&. Unlike any previous option, the \fB\-\-simplify\-merges\fR option requires walking the entire commit history before returning a single result\&. This can make the option difficult to use for very large repositories\&.
1457 The second issue is one of auditing\&. When many contributors are working on the same repository, it is important which merge commits introduced a change into an important branch\&. The problematic merge \fBR\fR above is not likely to be the merge commit that was used to merge into an important branch\&. Instead, the merge \fBN\fR was used to merge \fBR\fR and \fBX\fR into the important branch\&. This commit may have information about why the change \fBX\fR came to override the changes from \fBA\fR and \fBB\fR in its commit message\&.
1461 In addition to the commits shown in the default history, show each merge commit that is not TREESAME to its first parent but is TREESAME to a later parent\&.
1463 When a merge commit is included by
1464 \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
1465 \fB\-\-show\-pulls\fR
1466 on this example (and no other options) the resulting graph is:
1472 I\-\-\-X\-\-\-R\-\-\-N
1478 Here, the merge commits
1482 are included because they pulled the commits
1486 into the base branch, respectively\&. These merges are the reason the commits
1490 do not appear in the default history\&.
1493 \fB\-\-show\-pulls\fR
1495 \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
1501 \&.\-A\-\-\-M\-\-\&. N
1515 \fBR\fR, the edge from
1519 was simplified away\&. However,
1521 still appears in the history as an important commit because it "pulled" the change
1523 into the main branch\&.
1526 The \fB\-\-simplify\-by\-decoration\fR option allows you to view only the big picture of the topology of the history, by omitting commits that are not referenced by tags\&. Commits are marked as !TREESAME (in other words, kept after history simplification rules described above) if (1) they are referenced by tags, or (2) they change the contents of the paths given on the command line\&. All other commits are marked as TREESAME (subject to be simplified away)\&.
1527 .SS "Commit Ordering"
1529 By default, the commits are shown in reverse chronological order\&.
1533 Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order\&.
1536 \-\-author\-date\-order
1538 Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order\&.
1543 Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed\&.
1545 For example, in a commit history like this:
1551 \-\-\-1\-\-\-\-2\-\-\-\-4\-\-\-\-7
1553 3\-\-\-\-5\-\-\-\-6\-\-\-\-8\-\-\-
1559 where the numbers denote the order of commit timestamps,
1562 \fB\-\-date\-order\fR
1563 show the commits in the timestamp order: 8 7 6 5 4 3 2 1\&.
1566 \fB\-\-topo\-order\fR, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5 3 1); some older commits are shown before newer ones in order to avoid showing the commits from two parallel development track mixed together\&.
1571 Output the commits chosen to be shown (see Commit Limiting section above) in reverse order\&. Cannot be combined with
1572 \fB\-\-walk\-reflogs\fR\&.
1574 .SS "Object Traversal"
1576 These options are mostly targeted for packing of Git repositories\&.
1578 \-\-no\-walk[=(sorted|unsorted)]
1580 Only show the given commits, but do not traverse their ancestors\&. This has no effect if a range is specified\&. If the argument
1582 is given, the commits are shown in the order they were given on the command line\&. Otherwise (if
1584 or no argument was given), the commits are shown in reverse chronological order by commit time\&. Cannot be combined with
1590 Overrides a previous
1591 \fB\-\-no\-walk\fR\&.
1593 .SS "Commit Formatting"
1595 \-\-pretty[=<format>], \-\-format=<format>
1597 Pretty\-print the contents of the commit logs in a given format, where
1608 \fIformat:<string>\fR
1610 \fItformat:<string>\fR\&. When
1612 is none of the above, and has
1614 in it, it acts as if
1615 \fI\-\-pretty=tformat:<format>\fR
1618 See the "PRETTY FORMATS" section for some additional details for each format\&. When
1620 part is omitted, it defaults to
1623 Note: you can specify the default pretty format in the repository configuration (see
1624 \fBgit-config\fR(1))\&.
1629 Instead of showing the full 40\-byte hexadecimal commit object name, show a prefix that names the object uniquely\&. "\-\-abbrev=<n>" (which also modifies diff output, if it is displayed) option can be used to specify the minimum length of the prefix\&.
1631 This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
1634 \-\-no\-abbrev\-commit
1636 Show the full 40\-byte hexadecimal commit object name\&. This negates
1637 \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as "\-\-oneline"\&. It also overrides the
1638 \fBlog\&.abbrevCommit\fR
1644 This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
1647 \-\-encoding=<encoding>
1649 Commit objects record the character encoding used for the log message in their encoding header; this option can be used to tell the command to re\-code the commit log message in the encoding preferred by the user\&. For non plumbing commands this defaults to UTF\-8\&. Note that if an object claims to be encoded in
1651 and we are outputting in
1652 \fBX\fR, we will output the object verbatim; this means that invalid sequences in the original commit may be copied to the output\&. Likewise, if iconv(3) fails to convert the commit, we will quietly output the original object verbatim\&.
1655 \-\-expand\-tabs=<n>, \-\-expand\-tabs, \-\-no\-expand\-tabs
1657 Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of
1658 \fI<n>\fR) in the log message before showing it in the output\&.
1659 \fB\-\-expand\-tabs\fR
1660 is a short\-hand for
1661 \fB\-\-expand\-tabs=8\fR, and
1662 \fB\-\-no\-expand\-tabs\fR
1663 is a short\-hand for
1664 \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&.
1666 By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&.
1667 \fImedium\fR, which is the default,
1675 \fBgit-notes\fR(1)) that annotate the commit, when showing the commit log message\&. This is the default for
1679 \fBgit whatchanged\fR
1680 commands when there is no
1682 \fB\-\-format\fR, or
1684 option given on the command line\&.
1686 By default, the notes shown are from the notes refs listed in the
1687 \fBcore\&.notesRef\fR
1689 \fBnotes\&.displayRef\fR
1690 variables (or corresponding environment overrides)\&. See
1696 argument, use the ref to find the notes to display\&. The ref can specify the full refname when it begins with
1697 \fBrefs/notes/\fR; when it begins with
1702 is prefixed to form the full name of the ref\&.
1704 Multiple \-\-notes options can be combined to control which notes are being displayed\&. Examples: "\-\-notes=foo" will show only notes from "refs/notes/foo"; "\-\-notes=foo \-\-notes" will show both notes from "refs/notes/foo" and from the default notes ref(s)\&.
1709 Do not show notes\&. This negates the above
1711 option, by resetting the list of notes refs from which notes are shown\&. Options are parsed in the order given on the command line, so e\&.g\&. "\-\-notes \-\-notes=foo \-\-no\-notes \-\-notes=bar" will only show notes from "refs/notes/bar"\&.
1714 \-\-show\-notes\-by\-default
1716 Show the default notes unless options for displaying specific notes are given\&.
1719 \-\-show\-notes[=<ref>], \-\-[no\-]standard\-notes
1721 These options are deprecated\&. Use the above \-\-notes/\-\-no\-notes options instead\&.
1726 Check the validity of a signed commit object by passing the signature to
1727 \fBgpg \-\-verify\fR
1728 and show the output\&.
1734 \fB\-\-date=relative\fR\&.
1739 Only takes effect for dates shown in human\-readable format, such as when using
1742 config variable sets a default value for the log command\(cqs
1744 option\&. By default, dates are shown in the original time zone (either committer\(cqs or author\(cqs)\&. If
1746 is appended to the format (e\&.g\&.,
1747 \fBiso\-local\fR), the user\(cqs local time zone is used instead\&.
1749 \fB\-\-date=relative\fR
1750 shows dates relative to the current time, e\&.g\&.
1751 \(lq2 hours ago\(rq\&. The
1753 option has no effect for
1754 \fB\-\-date=relative\fR\&.
1756 \fB\-\-date=local\fR
1758 \fB\-\-date=default\-local\fR\&.
1762 \fB\-\-date=iso8601\fR) shows timestamps in a ISO 8601\-like format\&. The differences to the strict ISO 8601 format are:
1766 \h'-04'\(bu\h'+03'\c
1772 a space instead of the
1779 \h'-04'\(bu\h'+03'\c
1785 a space between time and time zone
1790 \h'-04'\(bu\h'+03'\c
1796 no colon between hours and minutes of the time zone
1799 \fB\-\-date=iso\-strict\fR
1801 \fB\-\-date=iso8601\-strict\fR) shows timestamps in strict ISO 8601 format\&.
1805 \fB\-\-date=rfc2822\fR) shows timestamps in RFC 2822 format, often found in email messages\&.
1807 \fB\-\-date=short\fR
1808 shows only the date, but not the time, in
1813 shows the date as seconds since the epoch (1970\-01\-01 00:00:00 UTC), followed by a space, and then the timezone as an offset from UTC (a
1817 with four digits; the first two are hours, and the second two are minutes)\&. I\&.e\&., as if the timestamp were formatted with
1818 \fBstrftime("%s %z")\fR)\&. Note that the
1820 option does not affect the seconds\-since\-epoch value (which is always measured in UTC), but does switch the accompanying timezone value\&.
1822 \fB\-\-date=human\fR
1823 shows the timezone if the timezone does not match the current time\-zone, and doesn\(cqt print the whole date if that matches (ie skip printing year for dates that are "this year", but also skip the whole date itself if it\(cqs in the last few days and we can just say what weekday it was)\&. For older dates the hour and minute is also omitted\&.
1826 shows the date as a Unix epoch timestamp (seconds since 1970)\&. As with
1827 \fB\-\-raw\fR, this is always in UTC and therefore
1831 \fB\-\-date=format:\&.\&.\&.\fR
1835 \fBstrftime\fR, except for %s, %z, and %Z, which are handled internally\&. Use
1836 \fB\-\-date=format:%c\fR
1837 to show the date in your system locale\(cqs preferred format\&. See the
1839 manual for a complete list of format placeholders\&. When using
1840 \fB\-local\fR, the correct syntax is
1841 \fB\-\-date=format\-local:\&.\&.\&.\fR\&.
1843 \fB\-\-date=default\fR
1844 is the default format, and is based on ctime(3) output\&. It shows a single line with three\-letter day of the week, three\-letter month, day\-of\-month, hour\-minute\-seconds in "HH:MM:SS" format, followed by 4\-digit year, plus timezone information, unless the local time zone is used, e\&.g\&.
1845 \fBThu Jan 1 00:00:00 1970 +0000\fR\&.
1850 Print also the parents of the commit (in the form "commit parent\&...\:")\&. Also enables parent rewriting, see
1851 \fIHistory Simplification\fR
1857 Print also the children of the commit (in the form "commit child\&...\:")\&. Also enables parent rewriting, see
1858 \fIHistory Simplification\fR
1864 Mark which side of a symmetric difference a commit is reachable from\&. Commits from the left side are prefixed with
1866 and those from the right with
1867 \fB>\fR\&. If combined with
1868 \fB\-\-boundary\fR, those commits are prefixed with
1871 For example, if you have this topology:
1877 y\-\-\-b\-\-\-b branch B
1881 o\-\-\-x\-\-\-a\-\-\-a branch A
1887 you would get an output like this:
1893 $ git rev\-list \-\-left\-right \-\-boundary \-\-pretty=oneline A\&.\&.\&.B
1895 >bbbbbbb\&.\&.\&. 3rd on b
1896 >bbbbbbb\&.\&.\&. 2nd on b
1897 <aaaaaaa\&.\&.\&. 3rd on a
1898 <aaaaaaa\&.\&.\&. 2nd on a
1899 \-yyyyyyy\&.\&.\&. 1st on b
1900 \-xxxxxxx\&.\&.\&. 1st on a
1909 Draw a text\-based graphical representation of the commit history on the left hand side of the output\&. This may cause extra lines to be printed in between commits, in order for the graph history to be drawn properly\&. Cannot be combined with
1910 \fB\-\-no\-walk\fR\&.
1912 This enables parent rewriting, see
1913 \fIHistory Simplification\fR
1917 \fB\-\-topo\-order\fR
1918 option by default, but the
1919 \fB\-\-date\-order\fR
1920 option may also be specified\&.
1923 \-\-show\-linear\-break[=<barrier>]
1925 When \-\-graph is not used, all history branches are flattened which can make it hard to see that the two consecutive commits do not belong to a linear branch\&. This option puts a barrier in between them in that case\&. If
1927 is specified, it is the string that will be shown instead of the default one\&.
1929 .SH "PRETTY FORMATS"
1931 If the commit is a merge, and if the pretty\-format is not \fIoneline\fR, \fIemail\fR or \fIraw\fR, an additional line is inserted before the \fIAuthor:\fR line\&. This line begins with "Merge: " and the hashes of ancestral commits are printed, separated by spaces\&. Note that the listed commits may not necessarily be the list of the \fBdirect\fR parent commits if you have limited your view of history: for example, if you are only interested in changes related to a certain directory or file\&.
1933 There are several built\-in formats, and you can define additional formats by setting a pretty\&.<name> config option to either another format name, or a \fIformat:\fR string, as described below (see \fBgit-config\fR(1))\&. Here are the details of the built\-in formats:
1937 \h'-04'\(bu\h'+03'\c
1949 <hash> <title\-line>
1955 This is designed to be as compact as possible\&.
1960 \h'-04'\(bu\h'+03'\c
1992 \h'-04'\(bu\h'+03'\c
2006 Date: <author\-date>
2026 <full\-commit\-message>
2035 \h'-04'\(bu\h'+03'\c
2069 <full\-commit\-message>
2078 \h'-04'\(bu\h'+03'\c
2092 AuthorDate: <author\-date>
2094 CommitDate: <committer\-date>
2114 <full\-commit\-message>
2123 \h'-04'\(bu\h'+03'\c
2135 <abbrev\-hash> (<title\-line>, <short\-author\-date>)
2141 This format is used to refer to another commit in a commit message and is the same as
2142 \fB\-\-pretty=\*(Aqformat:%C(auto)%h (%s, %ad)\*(Aq\fR\&. By default, the date is formatted with
2143 \fB\-\-date=short\fR
2146 option is explicitly specified\&. As with any
2148 with format placeholders, its output is not affected by other options like
2151 \fB\-\-walk\-reflogs\fR\&.
2156 \h'-04'\(bu\h'+03'\c
2170 Date: <author\-date>
2171 Subject: [PATCH] <title\-line>
2181 <full\-commit\-message>
2190 \h'-04'\(bu\h'+03'\c
2199 \fIemail\fR, but lines in the commit message starting with "From " (preceded by zero or more ">") are quoted with ">" so they aren\(cqt confused as starting a new commit\&.
2204 \h'-04'\(bu\h'+03'\c
2214 format shows the entire commit exactly as stored in the commit object\&. Notably, the hashes are displayed in full, regardless of whether \-\-abbrev or \-\-no\-abbrev are used, and
2216 information show the true parent commits, without taking grafts or history simplification into account\&. Note that this format affects the way commits are displayed, but not the way the diff is shown e\&.g\&. with
2217 \fBgit log \-\-raw\fR\&. To get full object names in a raw diff format, use
2218 \fB\-\-no\-abbrev\fR\&.
2223 \h'-04'\(bu\h'+03'\c
2229 \fIformat:<format\-string>\fR
2232 \fIformat:<format\-string>\fR
2233 format allows you to specify which information you want to show\&. It works a little bit like printf format, with the notable exception that you get a newline with
2239 \fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR
2240 would show something like this:
2246 The author of fe6e0ee was Junio C Hamano, 23 hours ago
2247 The title was >>t4119: test autocomputing \-p<n> for traditional diff input\&.<<
2253 The placeholders are:
2257 \h'-04'\(bu\h'+03'\c
2263 Placeholders that expand to a single literal character:
2279 followed by two hexadecimal digits is replaced with a byte with the hexadecimal digits\*(Aq value (we will call this "literal formatting code" in the rest of this document)\&.
2285 \h'-04'\(bu\h'+03'\c
2291 Placeholders that affect formatting of later placeholders:
2300 switch color to green
2305 switch color to blue
2315 color specification, as described under Values in the "CONFIGURATION FILE" section of
2316 \fBgit-config\fR(1)\&. By default, colors are shown only when enabled for log output (by
2318 \fBcolor\&.ui\fR, or
2319 \fB\-\-color\fR, and respecting the
2321 settings of the former if we are going to a terminal)\&.
2322 \fB%C(auto,\&.\&.\&.)\fR
2323 is accepted as a historical synonym for the default (e\&.g\&.,
2324 \fB%C(auto,red)\fR)\&. Specifying
2325 \fB%C(always,\&.\&.\&.)\fR
2326 will show the colors even when color is not otherwise enabled (though consider just using
2327 \fB\-\-color=always\fR
2328 to enable color for the whole output, including this format and anything else git might color)\&.
2331 \fB%C(auto)\fR) will turn on auto coloring on the next placeholders until the color is switched again\&.
2336 left (\fB<\fR), right (\fB>\fR) or boundary (\fB\-\fR) mark
2339 \fI%w([<w>[,<i1>[,<i2>]]])\fR
2341 switch line wrapping, like the \-w option of
2342 \fBgit-shortlog\fR(1)\&.
2345 \fI%<( <N> [,trunc|ltrunc|mtrunc])\fR
2347 make the next placeholder take at least N column widths, padding spaces on the right if necessary\&. Optionally truncate (with ellipsis
2348 \fI\&.\&.\fR) at the left (ltrunc)
2349 \fB\&.\&.ft\fR, the middle (mtrunc)
2350 \fBmi\&.\&.le\fR, or the end (trunc)
2351 \fBrig\&.\&.\fR, if the output is longer than N columns\&. Note 1: that truncating only works correctly with N >= 2\&. Note 2: spaces around the N and M (see below) values are optional\&. Note 3: Emojis and other wide characters will take two display columns, which may over\-run column boundaries\&. Note 4: decomposed character combining marks may be misplaced at padding boundaries\&.
2356 make the next placeholder take at least until Mth display column, padding spaces on the right if necessary\&. Use negative M values for column positions measured from the right hand edge of the terminal window\&.
2359 \fI%>( <N> )\fR, \fI%>|( <M> )\fR
2364 respectively, but padding spaces on the left
2367 \fI%>>( <N> )\fR, \fI%>>|( <M> )\fR
2372 respectively, except that if the next placeholder takes more spaces than given and there are spaces on its left, use those spaces
2375 \fI%><( <N> )\fR, \fI%><|( <M> )\fR
2380 respectively, but padding both sides (i\&.e\&. the text is centered)
2386 \h'-04'\(bu\h'+03'\c
2392 Placeholders that expand to information extracted from the commit:
2401 abbreviated commit hash
2411 abbreviated tree hash
2421 abbreviated parent hashes
2431 author name (respecting \&.mailmap, see
2432 \fBgit-shortlog\fR(1)
2444 author email (respecting \&.mailmap, see
2445 \fBgit-shortlog\fR(1)
2452 author email local\-part (the part before the
2459 author local\-part (see
2460 \fI%al\fR) respecting \&.mailmap, see
2461 \fBgit-shortlog\fR(1)
2468 author date (format respects \-\-date= option)
2473 author date, RFC2822 style
2478 author date, relative
2483 author date, UNIX timestamp
2488 author date, ISO 8601\-like format
2493 author date, strict ISO 8601 format
2498 author date, short format (\fBYYYY\-MM\-DD\fR)
2503 author date, human style (like the
2504 \fB\-\-date=human\fR
2506 \fBgit-rev-list\fR(1))
2516 committer name (respecting \&.mailmap, see
2517 \fBgit-shortlog\fR(1)
2529 committer email (respecting \&.mailmap, see
2530 \fBgit-shortlog\fR(1)
2537 committer email local\-part (the part before the
2544 committer local\-part (see
2545 \fI%cl\fR) respecting \&.mailmap, see
2546 \fBgit-shortlog\fR(1)
2553 committer date (format respects \-\-date= option)
2558 committer date, RFC2822 style
2563 committer date, relative
2568 committer date, UNIX timestamp
2573 committer date, ISO 8601\-like format
2578 committer date, strict ISO 8601 format
2583 committer date, short format (\fBYYYY\-MM\-DD\fR)
2588 committer date, human style (like the
2589 \fB\-\-date=human\fR
2591 \fBgit-rev-list\fR(1))
2596 ref names, like the \-\-decorate option of
2602 ref names without the " (", ")" wrapping\&.
2605 \fI%(decorate[:<options>])\fR
2607 ref names with custom decorations\&. The
2609 string may be followed by a colon and zero or more comma\-separated options\&. Option values may contain literal formatting codes\&. These must be used for commas (\fB%x2C\fR) and closing parentheses (\fB%x29\fR), due to their role in the option syntax\&.
2613 \h'-04'\(bu\h'+03'\c
2619 \fIprefix=<value>\fR: Shown before the list of ref names\&. Defaults to "\ \&\fB(\fR"\&.
2624 \h'-04'\(bu\h'+03'\c
2630 \fIsuffix=<value>\fR: Shown after the list of ref names\&. Defaults to "\fB)\fR"\&.
2635 \h'-04'\(bu\h'+03'\c
2641 \fIseparator=<value>\fR: Shown between ref names\&. Defaults to "\fB,\fR\ \&"\&.
2646 \h'-04'\(bu\h'+03'\c
2652 \fIpointer=<value>\fR: Shown between HEAD and the branch it points to, if any\&. Defaults to "\ \&\fB\->\fR\ \&"\&.
2657 \h'-04'\(bu\h'+03'\c
2663 \fItag=<value>\fR: Shown before tag names\&. Defaults to "\fBtag:\fR\ \&"\&.
2668 For example, to produce decorations with no wrapping or tag annotations, and spaces as separators:
2671 \fB%(decorate:prefix=,suffix=,tag=,separator= )\fR
2673 \fI%(describe[:<options>])\fR
2675 human\-readable name, like
2676 \fBgit-describe\fR(1); empty string for undescribable commits\&. The
2678 string may be followed by a colon and zero or more comma\-separated options\&. Descriptions can be inconsistent when tags are added or removed at the same time\&.
2682 \h'-04'\(bu\h'+03'\c
2688 \fItags[=<bool\-value>]\fR: Instead of only considering annotated tags, consider lightweight tags as well\&.
2693 \h'-04'\(bu\h'+03'\c
2699 \fIabbrev=<number>\fR: Instead of using the default number of hexadecimal digits (which will vary according to the number of objects in the repository with a default of 7) of the abbreviated object name, use <number> digits, or as many digits as needed to form a unique object name\&.
2704 \h'-04'\(bu\h'+03'\c
2710 \fImatch=<pattern>\fR: Only consider tags matching the given
2712 pattern, excluding the "refs/tags/" prefix\&.
2717 \h'-04'\(bu\h'+03'\c
2723 \fIexclude=<pattern>\fR: Do not consider tags matching the given
2725 pattern, excluding the "refs/tags/" prefix\&.
2731 ref name given on the command line by which the commit was reached (like
2732 \fBgit log \-\-source\fR), only works with
2748 sanitized subject line, suitable for a filename
2758 raw body (unwrapped subject and body)
2768 raw verification message from GPG for a signed commit
2773 show "G" for a good (valid) signature, "B" for a bad signature, "U" for a good signature with unknown validity, "X" for a good signature that has expired, "Y" for a good signature made by an expired key, "R" for a good signature made by a revoked key, "E" if the signature cannot be checked (e\&.g\&. missing key) and "N" for no signature
2778 show the name of the signer for a signed commit
2783 show the key used to sign a signed commit
2788 show the fingerprint of the key used to sign a signed commit
2793 show the fingerprint of the primary key whose subkey was used to sign a signed commit
2798 show the trust level for the key used to sign a signed commit
2803 reflog selector, e\&.g\&.,
2804 \fBrefs/stash@{1}\fR
2806 \fBrefs/stash@{2 minutes ago}\fR; the format follows the rules described for the
2808 option\&. The portion before the
2810 is the refname as given on the command line (so
2811 \fBgit log \-g refs/heads/master\fR
2813 \fBrefs/heads/master@{0}\fR)\&.
2818 shortened reflog selector; same as
2819 \fB%gD\fR, but the refname portion is shortened for human readability (so
2820 \fBrefs/heads/master\fR
2827 reflog identity name
2832 reflog identity name (respecting \&.mailmap, see
2833 \fBgit-shortlog\fR(1)
2840 reflog identity email
2845 reflog identity email (respecting \&.mailmap, see
2846 \fBgit-shortlog\fR(1)
2856 \fI%(trailers[:<options>])\fR
2858 display the trailers of the body as interpreted by
2859 \fBgit-interpret-trailers\fR(1)\&. The
2861 string may be followed by a colon and zero or more comma\-separated options\&. If any option is provided multiple times, the last occurrence wins\&.
2865 \h'-04'\(bu\h'+03'\c
2871 \fIkey=<key>\fR: only show trailers with specified <key>\&. Matching is done case\-insensitively and trailing colon is optional\&. If option is given multiple times trailer lines matching any of the keys are shown\&. This option automatically enables the
2873 option so that non\-trailer lines in the trailer block are hidden\&. If that is not desired it can be disabled with
2874 \fBonly=false\fR\&. E\&.g\&.,
2875 \fB%(trailers:key=Reviewed\-by)\fR
2876 shows trailer lines with key
2877 \fBReviewed\-by\fR\&.
2882 \h'-04'\(bu\h'+03'\c
2888 \fIonly[=<bool>]\fR: select whether non\-trailer lines from the trailer block should be included\&.
2893 \h'-04'\(bu\h'+03'\c
2899 \fIseparator=<sep>\fR: specify the separator inserted between trailer lines\&. Defaults to a line feed character\&. The string <sep> may contain the literal formatting codes described above\&. To use comma as separator one must use
2901 as it would otherwise be parsed as next option\&. E\&.g\&.,
2902 \fB%(trailers:key=Ticket,separator=%x2C )\fR
2903 shows all trailer lines whose key is "Ticket" separated by a comma and a space\&.
2908 \h'-04'\(bu\h'+03'\c
2914 \fIunfold[=<bool>]\fR: make it behave as if interpret\-trailer\(cqs
2916 option was given\&. E\&.g\&.,
2917 \fB%(trailers:only,unfold=true)\fR
2918 unfolds and shows all trailer lines\&.
2923 \h'-04'\(bu\h'+03'\c
2929 \fIkeyonly[=<bool>]\fR: only show the key part of the trailer\&.
2934 \h'-04'\(bu\h'+03'\c
2940 \fIvalueonly[=<bool>]\fR: only show the value part of the trailer\&.
2945 \h'-04'\(bu\h'+03'\c
2951 \fIkey_value_separator=<sep>\fR: specify the separator inserted between the key and value of each trailer\&. Defaults to ": "\&. Otherwise it shares the same semantics as
2952 \fIseparator=<sep>\fR
2962 .nr an-no-space-flag 1
2970 Some placeholders may depend on other options given to the revision traversal engine\&. For example, the \fB%g*\fR reflog options will insert an empty string unless we are traversing reflog entries (e\&.g\&., by \fBgit log \-g\fR)\&. The \fB%d\fR and \fB%D\fR placeholders will use the "short" decoration format if \fB\-\-decorate\fR was not already provided on the command line\&.
2974 The boolean options accept an optional value \fB[=<bool\-value>]\fR\&. The values \fBtrue\fR, \fBfalse\fR, \fBon\fR, \fBoff\fR etc\&. are all accepted\&. See the "boolean" sub\-section in "EXAMPLES" in \fBgit-config\fR(1)\&. If a boolean option is given with no value, it\(cqs enabled\&.
2976 If you add a \fB+\fR (plus sign) after \fI%\fR of a placeholder, a line\-feed is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&.
2978 If you add a \fB\-\fR (minus sign) after \fI%\fR of a placeholder, all consecutive line\-feeds immediately preceding the expansion are deleted if and only if the placeholder expands to an empty string\&.
2980 If you add a ` ` (space) after \fI%\fR of a placeholder, a space is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&.
2984 \h'-04'\(bu\h'+03'\c
2994 format works exactly like
2995 \fIformat:\fR, except that it provides "terminator" semantics instead of "separator" semantics\&. In other words, each commit has the message terminator character (usually a newline) appended, rather than a separator placed between entries\&. This means that the final entry of a single\-line format will be properly terminated with a new line, just as the "oneline" format does\&. For example:
3001 $ git log \-2 \-\-pretty=format:%h 4da45bef \e
3002 | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
3004 7134973 \-\- NO NEWLINE
3006 $ git log \-2 \-\-pretty=tformat:%h 4da45bef \e
3007 | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
3015 In addition, any unrecognized string that has a
3017 in it is interpreted as if it has
3019 in front of it\&. For example, these two are equivalent:
3025 $ git log \-2 \-\-pretty=tformat:%h 4da45bef
3026 $ git log \-2 \-\-pretty=%h 4da45bef
3032 .SH "DIFF FORMATTING"
3034 By default, \fBgit log\fR does not generate any diff output\&. The options below can be used to show the changes made by each commit\&.
3036 Note that unless one of \fB\-\-diff\-merges\fR variants (including short \fB\-m\fR, \fB\-c\fR, \fB\-\-cc\fR, and \fB\-\-dd\fR options) is explicitly given, merge commits will not show a diff, even if a diff format like \fB\-\-patch\fR is selected, nor will they match search options like \fB\-S\fR\&. The exception is when \fB\-\-first\-parent\fR is in use, in which case \fBfirst\-parent\fR is the default format for merge commits\&.
3041 the section called \(lqGENERATING PATCH TEXT WITH \-P\(rq)\&.
3046 Suppress all output from the diff machinery\&. Useful for commands like
3048 that show the patch by default to squelch their output, or to cancel the effect of options like
3051 earlier on the command line in an alias\&.
3056 Show diffs for merge commits in the default format\&. This is similar to
3057 \fI\-\-diff\-merges=on\fR, except
3059 will produce no output unless
3066 Produce combined diff output for merge commits\&. Shortcut for
3067 \fI\-\-diff\-merges=combined \-p\fR\&.
3072 Produce dense combined diff output for merge commits\&. Shortcut for
3073 \fI\-\-diff\-merges=dense\-combined \-p\fR\&.
3078 Produce diff with respect to first parent for both merge and regular commits\&. Shortcut for
3079 \fI\-\-diff\-merges=first\-parent \-p\fR\&.
3084 Produce remerge\-diff output for merge commits\&. Shortcut for
3085 \fI\-\-diff\-merges=remerge \-p\fR\&.
3088 \-\-no\-diff\-merges
3091 \fI\-\-diff\-merges=off\fR\&.
3094 \-\-diff\-merges=<format>
3096 Specify diff format to be used for merge commits\&. Default is `off` unless
3097 \fB\-\-first\-parent\fR
3098 is in use, in which case
3102 The following formats are supported:
3106 Disable output of diffs for merge commits\&. Useful to override implied value\&.
3111 Make diff output for merge commits to be shown in the default format\&. The default format can be changed using
3112 \fBlog\&.diffMerges\fR
3113 configuration variable, whose default value is
3119 Show full diff with respect to first parent\&. This is the same format as
3121 produces for non\-merge commits\&.
3126 Show full diff with respect to each of parents\&. Separate log entry and diff is generated for each parent\&.
3131 Show differences from each of the parents to the merge result simultaneously instead of showing pairwise diff between a parent and the result one at a time\&. Furthermore, it lists only files which were modified from all parents\&.
3136 Further compress output produced by
3137 \fB\-\-diff\-merges=combined\fR
3138 by omitting uninteresting hunks whose contents in the parents have only two variants and the merge result picks one of them without modification\&.
3143 Remerge two\-parent merge commits to create a temporary tree object\(em\:potentially containing files with conflict markers and such\&. A diff is then shown between that temporary tree and the actual merge commit\&.
3145 The output emitted when this option is used is subject to change, and so is its interaction with other options (unless explicitly documented)\&.
3149 \-\-combined\-all\-paths
3151 This flag causes combined diffs (used for merge commits) to list the name of the file from all parents\&. It thus only has effect when
3152 \fB\-\-diff\-merges=[dense\-]combined\fR
3153 is in use, and is likely only useful if filename changes are detected (i\&.e\&. when either rename or copy detection have been requested)\&.
3156 \-U<n>, \-\-unified=<n>
3158 Generate diffs with <n> lines of context instead of the usual three\&. Implies
3164 Output to a specific file instead of stdout\&.
3167 \-\-output\-indicator\-new=<char>, \-\-output\-indicator\-old=<char>, \-\-output\-indicator\-context=<char>
3169 Specify the character used to indicate new, old or context lines in the generated patch\&. Normally they are
3172 and \*(Aq \*(Aq respectively\&.
3177 For each commit, show a summary of changes using the raw diff format\&. See the "RAW OUTPUT FORMAT" section of
3178 \fBgit-diff\fR(1)\&. This is different from showing the log itself in raw format, which you can achieve with
3179 \fB\-\-format=raw\fR\&.
3182 \-\-patch\-with\-raw
3185 \fB\-p \-\-raw\fR\&.
3190 Show the tree objects in the diff output\&.
3193 \-\-indent\-heuristic
3195 Enable the heuristic that shifts diff hunk boundaries to make patches easier to read\&. This is the default\&.
3198 \-\-no\-indent\-heuristic
3200 Disable the indent heuristic\&.
3205 Spend extra time to make sure the smallest possible diff is produced\&.
3210 Generate a diff using the "patience diff" algorithm\&.
3215 Generate a diff using the "histogram diff" algorithm\&.
3220 Generate a diff using the "anchored diff" algorithm\&.
3222 This option may be specified more than once\&.
3224 If a line exists in both the source and destination, exists only once, and starts with this text, this algorithm attempts to prevent it from appearing as a deletion or addition in the output\&. It uses the "patience diff" algorithm internally\&.
3227 \-\-diff\-algorithm={patience|minimal|histogram|myers}
3229 Choose a diff algorithm\&. The variants are as follows:
3231 \fBdefault\fR, \fBmyers\fR
3233 The basic greedy diff algorithm\&. Currently, this is the default\&.
3238 Spend extra time to make sure the smallest possible diff is produced\&.
3243 Use "patience diff" algorithm when generating patches\&.
3248 This algorithm extends the patience algorithm to "support low\-occurrence common elements"\&.
3251 For instance, if you configured the
3252 \fBdiff\&.algorithm\fR
3253 variable to a non\-default value and want to use the default one, then you have to use
3254 \fB\-\-diff\-algorithm=default\fR
3258 \-\-stat[=<width>[,<name\-width>[,<count>]]]
3260 Generate a diffstat\&. By default, as much space as necessary will be used for the filename part, and the rest for the graph part\&. Maximum width defaults to terminal width, or 80 columns if not connected to a terminal, and can be overridden by
3261 \fB<width>\fR\&. The width of the filename part can be limited by giving another width
3263 after a comma or by setting
3264 \fBdiff\&.statNameWidth=<width>\fR\&. The width of the graph part can be limited by using
3265 \fB\-\-stat\-graph\-width=<width>\fR
3267 \fBdiff\&.statGraphWidth=<width>\fR\&. Using
3270 \fB\-\-stat\-graph\-width\fR
3271 affects all commands generating a stat graph, while setting
3272 \fBdiff\&.statNameWidth\fR
3274 \fBdiff\&.statGraphWidth\fR
3276 \fBgit format\-patch\fR\&. By giving a third parameter
3277 \fB<count>\fR, you can limit the output to the first
3281 if there are more\&.
3283 These parameters can also be set individually with
3284 \fB\-\-stat\-width=<width>\fR,
3285 \fB\-\-stat\-name\-width=<name\-width>\fR
3287 \fB\-\-stat\-count=<count>\fR\&.
3290 \-\-compact\-summary
3292 Output a condensed summary of extended header information such as file creations or deletions ("new" or "gone", optionally "+l" if it\(cqs a symlink) and mode changes ("+x" or "\-x" for adding or removing executable bit respectively) in diffstat\&. The information is put between the filename part and the graph part\&. Implies
3299 \fB\-\-stat\fR, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly\&. For binary files, outputs two
3307 Output only the last line of the
3309 format containing total number of modified files, as well as number of added and deleted lines\&.
3312 \-X[<param1,param2,\&...\:>], \-\-dirstat[=<param1,param2,\&...\:>]
3314 Output the distribution of relative amount of changes for each sub\-directory\&. The behavior of
3316 can be customized by passing it a comma separated list of parameters\&. The defaults are controlled by the
3317 \fBdiff\&.dirstat\fR
3318 configuration variable (see
3319 \fBgit-config\fR(1))\&. The following parameters are available:
3323 Compute the dirstat numbers by counting the lines that have been removed from the source, or added to the destination\&. This ignores the amount of pure code movements within a file\&. In other words, rearranging lines in a file is not counted as much as other changes\&. This is the default behavior when no parameter is given\&.
3328 Compute the dirstat numbers by doing the regular line\-based diff analysis, and summing the removed/added line counts\&. (For binary files, count 64\-byte chunks instead, since binary files have no natural concept of lines)\&. This is a more expensive
3332 behavior, but it does count rearranged lines within a file as much as other changes\&. The resulting output is consistent with what you get from the other
3339 Compute the dirstat numbers by counting the number of files changed\&. Each changed file counts equally in the dirstat analysis\&. This is the computationally cheapest
3341 behavior, since it does not have to look at the file contents at all\&.
3346 Count changes in a child directory for the parent directory as well\&. Note that when using
3347 \fBcumulative\fR, the sum of the percentages reported may exceed 100%\&. The default (non\-cumulative) behavior can be specified with the
3354 An integer parameter specifies a cut\-off percent (3% by default)\&. Directories contributing less than this percentage of the changes are not shown in the output\&.
3357 Example: The following will count changed files, while ignoring directories with less than 10% of the total amount of changed files, and accumulating child directory counts in the parent directories:
3358 \fB\-\-dirstat=files,10,cumulative\fR\&.
3363 Synonym for \-\-dirstat=cumulative
3366 \-\-dirstat\-by\-file[=<param1,param2>\&...\:]
3368 Synonym for \-\-dirstat=files,<param1>,<param2>\&...\:
3373 Output a condensed summary of extended header information such as creations, renames and mode changes\&.
3376 \-\-patch\-with\-stat
3379 \fB\-p \-\-stat\fR\&.
3384 Separate the commits with NULs instead of newlines\&.
3390 has been given, do not munge pathnames and use NULs as output field terminators\&.
3392 Without this option, pathnames with "unusual" characters are quoted as explained for the configuration variable
3393 \fBcore\&.quotePath\fR
3395 \fBgit-config\fR(1))\&.
3400 Show only the name of each changed file in the post\-image tree\&. The file names are often encoded in UTF\-8\&. For more information see the discussion about encoding in the
3407 Show only the name(s) and status of each changed file\&. See the description of the
3408 \fB\-\-diff\-filter\fR
3409 option on what the status letters mean\&. Just like
3410 \fB\-\-name\-only\fR
3411 the file names are often encoded in UTF\-8\&.
3414 \-\-submodule[=<format>]
3416 Specify how differences in submodules are shown\&. When specifying
3417 \fB\-\-submodule=short\fR
3420 format is used\&. This format just shows the names of the commits at the beginning and end of the range\&. When
3423 \fB\-\-submodule=log\fR
3426 format is used\&. This format lists the commits in the range like
3427 \fBgit-submodule\fR(1)
3430 \fB\-\-submodule=diff\fR
3433 format is used\&. This format shows an inline diff of the changes in the submodule contents between the commit range\&. Defaults to
3434 \fBdiff\&.submodule\fR
3437 format if the config option is unset\&.
3442 Show colored diff\&.
3445 \fI=<when>\fR) is the same as
3446 \fB\-\-color=always\fR\&.
3456 Turn off colored diff\&. It is the same as
3457 \fB\-\-color=never\fR\&.
3460 \-\-color\-moved[=<mode>]
3462 Moved lines of code are colored differently\&. The <mode> defaults to
3464 if the option is not given and to
3466 if the option with no mode is given\&. The mode must be one of:
3470 Moved lines are not highlighted\&.
3476 \fBzebra\fR\&. This may change to a more sensible mode in the future\&.
3481 Any line that is added in one location and was removed in another location will be colored with
3482 \fIcolor\&.diff\&.newMoved\fR\&. Similarly
3483 \fIcolor\&.diff\&.oldMoved\fR
3484 will be used for removed lines that are added somewhere else in the diff\&. This mode picks up any moved line, but it is not very useful in a review to determine if a block of code was moved without permutation\&.
3489 Blocks of moved text of at least 20 alphanumeric characters are detected greedily\&. The detected blocks are painted using either the
3490 \fIcolor\&.diff\&.{old,new}Moved\fR
3491 color\&. Adjacent blocks cannot be told apart\&.
3496 Blocks of moved text are detected as in
3498 mode\&. The blocks are painted using either the
3499 \fIcolor\&.diff\&.{old,new}Moved\fR
3501 \fIcolor\&.diff\&.{old,new}MovedAlternative\fR\&. The change between the two colors indicates that a new block was detected\&.
3507 \fIzebra\fR, but additional dimming of uninteresting parts of moved code is performed\&. The bordering lines of two adjacent blocks are considered interesting, the rest is uninteresting\&.
3509 is a deprecated synonym\&.
3513 \-\-no\-color\-moved
3515 Turn off move detection\&. This can be used to override configuration settings\&. It is the same as
3516 \fB\-\-color\-moved=no\fR\&.
3519 \-\-color\-moved\-ws=<modes>
3521 This configures how whitespace is ignored when performing the move detection for
3522 \fB\-\-color\-moved\fR\&. These modes can be given as a comma separated list:
3526 Do not ignore whitespace when performing move detection\&.
3529 ignore\-space\-at\-eol
3531 Ignore changes in whitespace at EOL\&.
3534 ignore\-space\-change
3536 Ignore changes in amount of whitespace\&. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent\&.
3541 Ignore whitespace when comparing lines\&. This ignores differences even if one line has whitespace where the other line has none\&.
3544 allow\-indentation\-change
3546 Initially ignore any whitespace in the move detection, then group the moved code blocks only into a block if the change in whitespace is the same per line\&. This is incompatible with the other modes\&.
3550 \-\-no\-color\-moved\-ws
3552 Do not ignore whitespace when performing move detection\&. This can be used to override configuration settings\&. It is the same as
3553 \fB\-\-color\-moved\-ws=no\fR\&.
3556 \-\-word\-diff[=<mode>]
3558 Show a word diff, using the <mode> to delimit changed words\&. By default, words are delimited by whitespace; see
3559 \fB\-\-word\-diff\-regex\fR
3560 below\&. The <mode> defaults to
3561 \fIplain\fR, and must be one of:
3565 Highlight changed words using only colors\&. Implies
3574 \fB{+added+}\fR\&. Makes no attempts to escape the delimiters if they appear in the input, so the output may be ambiguous\&.
3579 Use a special line\-based format intended for script consumption\&. Added/removed/unchanged runs are printed in the usual unified diff format, starting with a
3580 \fB+\fR/\fB\-\fR/` ` character at the beginning of the line and extending to the end of the line\&. Newlines in the input are represented by a tilde
3582 on a line of its own\&.
3587 Disable word diff again\&.
3590 Note that despite the name of the first mode, color is used to highlight the changed parts in all modes if enabled\&.
3593 \-\-word\-diff\-regex=<regex>
3595 Use <regex> to decide what a word is, instead of considering runs of non\-whitespace to be a word\&. Also implies
3596 \fB\-\-word\-diff\fR
3597 unless it was already enabled\&.
3599 Every non\-overlapping match of the <regex> is considered a word\&. Anything between these matches is considered whitespace and ignored(!) for the purposes of finding differences\&. You may want to append
3601 to your regular expression to make sure that it matches all non\-whitespace characters\&. A match that contains a newline is silently truncated(!) at the newline\&.
3604 \fB\-\-word\-diff\-regex=\&.\fR
3605 will treat each character as a word and, correspondingly, show differences character by character\&.
3607 The regex can also be set via a diff driver or configuration option, see
3608 \fBgitattributes\fR(5)
3610 \fBgit-config\fR(1)\&. Giving it explicitly overrides any diff driver or configuration setting\&. Diff drivers override configuration settings\&.
3613 \-\-color\-words[=<regex>]
3616 \fB\-\-word\-diff=color\fR
3617 plus (if a regex was specified)
3618 \fB\-\-word\-diff\-regex=<regex>\fR\&.
3623 Turn off rename detection, even when the configuration file gives the default to do so\&.
3626 \-\-[no\-]rename\-empty
3628 Whether to use empty blobs as rename source\&.
3633 Warn if changes introduce conflict markers or whitespace errors\&. What are considered whitespace errors is controlled by
3634 \fBcore\&.whitespace\fR
3635 configuration\&. By default, trailing whitespaces (including lines that consist solely of whitespaces) and a space character that is immediately followed by a tab character inside the initial indent of the line are considered whitespace errors\&. Exits with non\-zero status if problems are found\&. Not compatible with \-\-exit\-code\&.
3638 \-\-ws\-error\-highlight=<kind>
3640 Highlight whitespace errors in the
3645 lines of the diff\&. Multiple values are separated by comma,
3647 resets previous values,
3654 \fBold,new,context\fR\&. When this option is not given, and the configuration variable
3655 \fBdiff\&.wsErrorHighlight\fR
3656 is not set, only whitespace errors in
3658 lines are highlighted\&. The whitespace errors are colored with
3659 \fBcolor\&.diff\&.whitespace\fR\&.
3664 Instead of the first handful of characters, show the full pre\- and post\-image blob object names on the "index" line when generating patch format output\&.
3670 \fB\-\-full\-index\fR, output a binary diff that can be applied with
3671 \fBgit\-apply\fR\&. Implies
3677 Instead of showing the full 40\-byte hexadecimal object name in diff\-raw format output and diff\-tree header lines, show the shortest prefix that is at least
3679 hexdigits long that uniquely refers the object\&. In diff\-patch output format,
3680 \fB\-\-full\-index\fR
3681 takes higher precedence, i\&.e\&. if
3682 \fB\-\-full\-index\fR
3683 is specified, full blob names will be shown regardless of
3684 \fB\-\-abbrev\fR\&. Non default number of digits can be specified with
3685 \fB\-\-abbrev=<n>\fR\&.
3688 \-B[<n>][/<m>], \-\-break\-rewrites[=[<n>][/<m>]]
3690 Break complete rewrite changes into pairs of delete and create\&. This serves two purposes:
3692 It affects the way a change that amounts to a total rewrite of a file not as a series of deletion and insertion mixed together with a very few lines that happen to match textually as the context, but as a single deletion of everything old followed by a single insertion of everything new, and the number
3694 controls this aspect of the \-B option (defaults to 60%)\&.
3696 specifies that less than 30% of the original should remain in the result for Git to consider it a total rewrite (i\&.e\&. otherwise the resulting patch will be a series of deletion and insertion mixed together with context lines)\&.
3698 When used with \-M, a totally\-rewritten file is also considered as the source of a rename (usually \-M only considers a file that disappeared as the source of a rename), and the number
3700 controls this aspect of the \-B option (defaults to 50%)\&.
3702 specifies that a change with addition and deletion compared to 20% or more of the file\(cqs size are eligible for being picked up as a possible source of a rename to another file\&.
3705 \-M[<n>], \-\-find\-renames[=<n>]
3707 If generating diffs, detect and report renames for each commit\&. For following files across renames while traversing history, see
3708 \fB\-\-follow\fR\&. If
3710 is specified, it is a threshold on the similarity index (i\&.e\&. amount of addition/deletions compared to the file\(cqs size)\&. For example,
3712 means Git should consider a delete/add pair to be a rename if more than 90% of the file hasn\(cqt changed\&. Without a
3714 sign, the number is to be read as a fraction, with a decimal point before it\&. I\&.e\&.,
3716 becomes 0\&.5, and is thus the same as
3717 \fB\-M50%\fR\&. Similarly,
3720 \fB\-M5%\fR\&. To limit detection to exact renames, use
3721 \fB\-M100%\fR\&. The default similarity index is 50%\&.
3724 \-C[<n>], \-\-find\-copies[=<n>]
3726 Detect copies as well as renames\&. See also
3727 \fB\-\-find\-copies\-harder\fR\&. If
3729 is specified, it has the same meaning as for
3733 \-\-find\-copies\-harder
3735 For performance reasons, by default,
3737 option finds copies only if the original file of the copy was modified in the same changeset\&. This flag makes the command inspect unmodified files as candidates for the source of copy\&. This is a very expensive operation for large projects, so use it with caution\&. Giving more than one
3739 option has the same effect\&.
3742 \-D, \-\-irreversible\-delete
3744 Omit the preimage for deletes, i\&.e\&. print only the header but not the diff between the preimage and
3745 \fB/dev/null\fR\&. The resulting patch is not meant to be applied with
3748 \fBgit apply\fR; this is solely for people who want to just concentrate on reviewing the text after the change\&. In addition, the output obviously lacks enough information to apply such a patch in reverse, even manually, hence the name of the option\&.
3750 When used together with
3751 \fB\-B\fR, omit also the preimage in the deletion part of a delete/create pair\&.
3760 options involve some preliminary steps that can detect subsets of renames/copies cheaply, followed by an exhaustive fallback portion that compares all remaining unpaired destinations to all relevant sources\&. (For renames, only remaining unpaired sources are relevant; for copies, all original sources are relevant\&.) For N sources and destinations, this exhaustive check is O(N^2)\&. This option prevents the exhaustive portion of rename/copy detection from running if the number of source/destination files involved exceeds the specified number\&. Defaults to diff\&.renameLimit\&. Note that a value of 0 is treated as unlimited\&.
3763 \-\-diff\-filter=[(A|C|D|M|R|T|U|X|B)\&...\:[*]]
3765 Select only files that are Added (\fBA\fR), Copied (\fBC\fR), Deleted (\fBD\fR), Modified (\fBM\fR), Renamed (\fBR\fR), have their type (i\&.e\&. regular file, symlink, submodule, \&...\:) changed (\fBT\fR), are Unmerged (\fBU\fR), are Unknown (\fBX\fR), or have had their pairing Broken (\fBB\fR)\&. Any combination of the filter characters (including none) can be used\&. When
3767 (All\-or\-none) is added to the combination, all paths are selected if there is any file that matches other criteria in the comparison; if there is no file that matches other criteria, nothing is selected\&.
3769 Also, these upper\-case letters can be downcased to exclude\&. E\&.g\&.
3770 \fB\-\-diff\-filter=ad\fR
3771 excludes added and deleted paths\&.
3773 Note that not all diffs can feature all types\&. For instance, copied and renamed entries cannot appear if detection for those types is disabled\&.
3778 Look for differences that change the number of occurrences of the specified string (i\&.e\&. addition/deletion) in a file\&. Intended for the scripter\(cqs use\&.
3780 It is useful when you\(cqre looking for an exact block of code (like a struct), and want to know the history of that block since it first came into being: use the feature iteratively to feed the interesting block in the preimage back into
3781 \fB\-S\fR, and keep going until you get the very first version of the block\&.
3783 Binary files are searched as well\&.
3788 Look for differences whose patch text contains added/removed lines that match <regex>\&.
3790 To illustrate the difference between
3791 \fB\-S<regex> \-\-pickaxe\-regex\fR
3793 \fB\-G<regex>\fR, consider a commit with the following diff in the same file:
3799 + return frotz(nitfol, two\->ptr, 1, 0);
3801 \- hit = frotz(nitfol, mf2\&.ptr, 1, 0);
3808 \fBgit log \-G"frotz\e(nitfol"\fR
3809 will show this commit,
3810 \fBgit log \-S"frotz\e(nitfol" \-\-pickaxe\-regex\fR
3811 will not (because the number of occurrences of that string did not change)\&.
3815 is supplied patches of binary files without a textconv filter will be ignored\&.
3820 \fBgitdiffcore\fR(7)
3821 for more information\&.
3824 \-\-find\-object=<object\-id>
3826 Look for differences that change the number of occurrences of the specified object\&. Similar to
3827 \fB\-S\fR, just the argument is different in that it doesn\(cqt search for a specific string but for a specific object id\&.
3829 The object can be a blob or a submodule commit\&. It implies the
3833 to also find trees\&.
3842 finds a change, show all the changes in that changeset, not just the files that contain the change in <string>\&.
3847 Treat the <string> given to
3849 as an extended POSIX regular expression to match\&.
3854 Control the order in which files appear in the output\&. This overrides the
3855 \fBdiff\&.orderFile\fR
3856 configuration variable (see
3857 \fBgit-config\fR(1))\&. To cancel
3858 \fBdiff\&.orderFile\fR, use
3859 \fB\-O/dev/null\fR\&.
3861 The output order is determined by the order of glob patterns in <orderfile>\&. All files with pathnames that match the first pattern are output first, all files with pathnames that match the second pattern (but not the first) are output next, and so on\&. All files with pathnames that do not match any pattern are output last, as if there was an implicit match\-all pattern at the end of the file\&. If multiple pathnames have the same rank (they match the same pattern but no earlier patterns), their output order relative to each other is the normal order\&.
3863 <orderfile> is parsed as follows:
3867 \h'-04'\(bu\h'+03'\c
3873 Blank lines are ignored, so they can be used as separators for readability\&.
3878 \h'-04'\(bu\h'+03'\c
3884 Lines starting with a hash ("\fB#\fR") are ignored, so they can be used for comments\&. Add a backslash ("\fB\e\fR") to the beginning of the pattern if it starts with a hash\&.
3889 \h'-04'\(bu\h'+03'\c
3895 Each other line contains a single pattern\&.
3898 Patterns have the same syntax and semantics as patterns used for fnmatch(3) without the FNM_PATHNAME flag, except a pathname also matches a pattern if removing any number of the final pathname components matches the pattern\&. For example, the pattern "\fBfoo*bar\fR" matches "\fBfooasdfbar\fR" and "\fBfoo/bar/baz/asdf\fR" but not "\fBfoobarx\fR"\&.
3901 \-\-skip\-to=<file>, \-\-rotate\-to=<file>
3903 Discard the files before the named <file> from the output (i\&.e\&.
3904 \fIskip to\fR), or move them to the end of the output (i\&.e\&.
3905 \fIrotate to\fR)\&. These options were invented primarily for the use of the
3907 command, and may not be very useful otherwise\&.
3912 Swap two inputs; that is, show differences from index or on\-disk file to tree contents\&.
3915 \-\-relative[=<path>], \-\-no\-relative
3917 When run from a subdirectory of the project, it can be told to exclude changes outside the directory and show pathnames relative to it with this option\&. When you are not in a subdirectory (e\&.g\&. in a bare repository), you can name which subdirectory to make the output relative to by giving a <path> as an argument\&.
3918 \fB\-\-no\-relative\fR
3919 can be used to countermand both
3920 \fBdiff\&.relative\fR
3921 config option and previous
3922 \fB\-\-relative\fR\&.
3927 Treat all files as text\&.
3930 \-\-ignore\-cr\-at\-eol
3932 Ignore carriage\-return at the end of line when doing a comparison\&.
3935 \-\-ignore\-space\-at\-eol
3937 Ignore changes in whitespace at EOL\&.
3940 \-b, \-\-ignore\-space\-change
3942 Ignore changes in amount of whitespace\&. This ignores whitespace at line end, and considers all other sequences of one or more whitespace characters to be equivalent\&.
3945 \-w, \-\-ignore\-all\-space
3947 Ignore whitespace when comparing lines\&. This ignores differences even if one line has whitespace where the other line has none\&.
3950 \-\-ignore\-blank\-lines
3952 Ignore changes whose lines are all blank\&.
3955 \-I<regex>, \-\-ignore\-matching\-lines=<regex>
3957 Ignore changes whose all lines match <regex>\&. This option may be specified more than once\&.
3960 \-\-inter\-hunk\-context=<lines>
3962 Show the context between diff hunks, up to the specified number of lines, thereby fusing hunks that are close to each other\&. Defaults to
3963 \fBdiff\&.interHunkContext\fR
3964 or 0 if the config option is unset\&.
3967 \-W, \-\-function\-context
3969 Show whole function as context lines for each change\&. The function names are determined in the same way as
3971 works out patch hunk headers (see
3972 \fIDefining a custom hunk\-header\fR
3974 \fBgitattributes\fR(5))\&.
3979 Allow an external diff helper to be executed\&. If you set an external diff driver with
3980 \fBgitattributes\fR(5), you need to use this option with
3987 Disallow external diff drivers\&.
3990 \-\-textconv, \-\-no\-textconv
3992 Allow (or disallow) external text conversion filters to be run when comparing binary files\&. See
3993 \fBgitattributes\fR(5)
3994 for details\&. Because textconv filters are typically a one\-way conversion, the resulting diff is suitable for human consumption, but cannot be applied\&. For this reason, textconv filters are enabled by default only for
3997 \fBgit-log\fR(1), but not for
3998 \fBgit-format-patch\fR(1)
3999 or diff plumbing commands\&.
4002 \-\-ignore\-submodules[=<when>]
4004 Ignore changes to submodules in the diff generation\&. <when> can be either "none", "untracked", "dirty" or "all", which is the default\&. Using "none" will consider the submodule modified when it either contains untracked or modified files or its HEAD differs from the commit recorded in the superproject and can be used to override any settings of the
4009 \fBgitmodules\fR(5)\&. When "untracked" is used submodules are not considered dirty when they only contain untracked content (but they are still scanned for modified content)\&. Using "dirty" ignores all changes to the work tree of submodules, only changes to the commits stored in the superproject are shown (this was the behavior until 1\&.7\&.0)\&. Using "all" hides all changes to submodules\&.
4012 \-\-src\-prefix=<prefix>
4014 Show the given source prefix instead of "a/"\&.
4017 \-\-dst\-prefix=<prefix>
4019 Show the given destination prefix instead of "b/"\&.
4024 Do not show any source or destination prefix\&.
4029 Use the default source and destination prefixes ("a/" and "b/")\&. This overrides configuration variables such as
4030 \fBdiff\&.noprefix\fR,
4031 \fBdiff\&.srcPrefix\fR,
4032 \fBdiff\&.dstPrefix\fR, and
4033 \fBdiff\&.mnemonicPrefix\fR
4035 \fBgit\-config\fR(1))\&.
4038 \-\-line\-prefix=<prefix>
4040 Prepend an additional prefix to every line of output\&.
4043 \-\-ita\-invisible\-in\-index
4045 By default entries added by "git add \-N" appear as an existing empty file in "git diff" and a new file in "git diff \-\-cached"\&. This option makes the entry appear as a new file in "git diff" and non\-existent in "git diff \-\-cached"\&. This option could be reverted with
4046 \fB\-\-ita\-visible\-in\-index\fR\&. Both options are experimental and could be removed in future\&.
4049 For more detailed explanation on these common options, see also \fBgitdiffcore\fR(7)\&.
4050 .SH "GENERATING PATCH TEXT WITH \-P"
4052 Running \fBgit-diff\fR(1), \fBgit-log\fR(1), \fBgit-show\fR(1), \fBgit-diff-index\fR(1), \fBgit-diff-tree\fR(1), or \fBgit-diff-files\fR(1) with the \fB\-p\fR option produces patch text\&. You can customize the creation of patch text via the \fBGIT_EXTERNAL_DIFF\fR and the \fBGIT_DIFF_OPTS\fR environment variables (see \fBgit\fR(1)), and the \fBdiff\fR attribute (see \fBgitattributes\fR(5))\&.
4054 What the \-p option produces is slightly different from the traditional diff format:
4064 It is preceded by a "git diff" header that looks like this:
4070 diff \-\-git a/file1 b/file2
4080 filenames are the same unless rename/copy is involved\&. Especially, even for a creation or a deletion,
4084 used in place of the
4090 When a rename/copy is involved,
4094 show the name of the source file of the rename/copy and the name of the file that the rename/copy produces, respectively\&.
4105 It is followed by one or more extended header lines:
4113 deleted file mode <mode>
4114 new file mode <mode>
4119 similarity index <number>
4120 dissimilarity index <number>
4121 index <hash>\&.\&.<hash> <mode>
4127 File modes are printed as 6\-digit octal numbers including the file type and file permission bits\&.
4129 Path names in extended headers do not include the
4135 The similarity index is the percentage of unchanged lines, and the dissimilarity index is the percentage of changed lines\&. It is a rounded down integer, followed by a percent sign\&. The similarity index value of 100% is thus reserved for two equal files, while 100% dissimilarity means that no line from the old file made it into the new one\&.
4137 The index line includes the blob object names before and after the change\&. The <mode> is included if the file mode does not change; otherwise, separate lines indicate the old and the new mode\&.
4148 Pathnames with "unusual" characters are quoted as explained for the configuration variable
4149 \fBcore\&.quotePath\fR
4151 \fBgit-config\fR(1))\&.
4164 files in the output refer to files before the commit, and all the
4166 files refer to files after the commit\&. It is incorrect to apply each change to each file sequentially\&. For example, this patch will swap a and b:
4172 diff \-\-git a/a b/b
4175 diff \-\-git a/b b/a
4192 Hunk headers mention the name of the function to which the hunk applies\&. See "Defining a custom hunk\-header" in
4193 \fBgitattributes\fR(5)
4194 for details of how to tailor this to specific languages\&.
4196 .SH "COMBINED DIFF FORMAT"
4198 Any diff\-generating command can take the \fB\-c\fR or \fB\-\-cc\fR option to produce a \fIcombined diff\fR when showing a merge\&. This is the default format when showing merges with \fBgit-diff\fR(1) or \fBgit-show\fR(1)\&. Note also that you can give suitable \fB\-\-diff\-merges\fR option to any of these commands to force generation of diffs in a specific format\&.
4200 A "combined diff" format looks like this:
4206 diff \-\-combined describe\&.c
4207 index fabadb8,cc95eb0\&.\&.4866510
4208 \-\-\- a/describe\&.c
4210 @@@ \-98,20 \-98,12 +98,20 @@@
4211 return (a_date > b_date) ? \-1 : (a_date == b_date) ? 0 : 1;
4214 \- static void describe(char *arg)
4215 \-static void describe(struct commit *cmit, int last_one)
4216 ++static void describe(char *arg, int last_one)
4218 + unsigned char sha1[20];
4219 + struct commit *cmit;
4220 struct commit_list *list;
4221 static int initialized = 0;
4222 struct commit_name *n;
4224 + if (get_sha1(arg, sha1) < 0)
4225 + usage(describe_usage);
4226 + cmit = lookup_commit_reference(sha1);
4228 + usage(describe_usage);
4232 for_each_ref(get_name);
4246 It is preceded by a "git diff" header, that looks like this (when the
4254 diff \-\-combined file
4260 or like this (when the
4283 It is followed by one or more extended header lines (this example shows a merge with two parents):
4289 index <hash>,<hash>\&.\&.<hash>
4290 mode <mode>,<mode>\&.\&.<mode>
4291 new file mode <mode>
4292 deleted file mode <mode>,<mode>
4299 \fBmode <mode>,<mode>\&.\&.<mode>\fR
4300 line appears only if at least one of the <mode> is different from the rest\&. Extended headers with information about detected content movement (renames and copying detection) are designed to work with the diff of two <tree\-ish> and are not used by combined diff format\&.
4311 It is followed by a two\-line from\-file/to\-file header:
4324 Similar to the two\-line header for the traditional
4328 is used to signal created or deleted files\&.
4330 However, if the \-\-combined\-all\-paths option is provided, instead of a two\-line from\-file/to\-file, you get an N+1 line from\-file/to\-file header, where N is the number of parents in the merge commit:
4345 This extended format can be useful if rename or copy detection is active, to allow you to see the original name of the file in different parents\&.
4356 Chunk header format is modified to prevent people from accidentally feeding it to
4357 \fBpatch \-p1\fR\&. Combined diff format was created for review of merge commit changes, and was not meant to be applied\&. The change is similar to the change in the extended
4365 @@@ <from\-file\-range> <from\-file\-range> <to\-file\-range> @@@
4371 There are (number of parents + 1)
4373 characters in the chunk header for combined diff format\&.
4376 Unlike the traditional \fIunified\fR diff format, which shows two files A and B with a single column that has \fB\-\fR (minus \(em appears in A but removed in B), \fB+\fR (plus \(em missing in A but added to B), or \fB" "\fR (space \(em unchanged) prefix, this format compares two or more files file1, file2,\&...\: with one file X, and shows how X differs from each of fileN\&. One column for each of fileN is prepended to the output line to note how X\(cqs line is different from it\&.
4378 A \fB\-\fR character in the column N means that the line appears in fileN but it does not appear in the result\&. A \fB+\fR character in the column N means that the line appears in the result, and fileN does not have that line (in other words, the line was added, from the point of view of that parent)\&.
4380 In the above example output, the function signature was changed from both files (hence two \fB\-\fR removals from both file1 and file2, plus \fB++\fR to mean one line that was added does not appear in either file1 or file2)\&. Also, eight other lines are the same from file1 but do not appear in file2 (hence prefixed with \fB+\fR)\&.
4382 When shown by \fBgit diff\-tree \-c\fR, it compares the parents of a merge commit with the merge result (i\&.e\&. file1\&.\&.fileN are the parents)\&. When shown by \fBgit diff\-files \-c\fR, it compares the two unresolved merge parents with the working tree file (i\&.e\&. file1 is stage 2 aka "our version", file2 is stage 3 aka "their version")\&.
4385 \fBgit log \-\-no\-merges\fR
4387 Show the whole commit history, but skip any merges
4390 \fBgit log v2\&.6\&.12\&.\&. include/scsi drivers/scsi\fR
4392 Show all commits since version
4394 that changed any file in the
4401 \fBgit log \-\-since="2 weeks ago" \-\- gitk\fR
4403 Show the changes during the last two weeks to the file
4406 is necessary to avoid confusion with the
4412 \fBgit log \-\-name\-status release\&.\&.test\fR
4414 Show the commits that are in the "test" branch but not yet in the "release" branch, along with the list of paths each commit modifies\&.
4417 \fBgit log \-\-follow builtin/rev\-list\&.c\fR
4419 Shows the commits that changed
4420 \fBbuiltin/rev\-list\&.c\fR, including those commits that occurred before the file was given its present name\&.
4423 \fBgit log \-\-branches \-\-not \-\-remotes=origin\fR
4425 Shows all commits that are in any of local branches but not in any of remote\-tracking branches for
4427 (what you have that origin doesn\(cqt)\&.
4430 \fBgit log master \-\-not \-\-remotes=*/master\fR
4432 Shows all commits that are in local master but not in any remote repository master branches\&.
4435 \fBgit log \-p \-m \-\-first\-parent\fR
4437 Shows the history including change diffs, but only from the
4439 perspective, skipping commits that come from merged branches, and showing full diffs of changes introduced by the merges\&. This makes sense only when following a strict policy of merging all topic branches when staying on a single integration branch\&.
4442 \fBgit log \-L \*(Aq/int main/\*(Aq,/^}/:main\&.c\fR
4444 Shows how the function
4448 evolved over time\&.
4453 Limits the number of commits to show to 3\&.
4457 Git is to some extent character encoding agnostic\&.
4461 \h'-04'\(bu\h'+03'\c
4467 The contents of the blob objects are uninterpreted sequences of bytes\&. There is no encoding translation at the core level\&.
4472 \h'-04'\(bu\h'+03'\c
4478 Path names are encoded in UTF\-8 normalization form C\&. This applies to tree objects, the index file, ref names, as well as path names in command line arguments, environment variables and config files (\fB\&.git/config\fR
4480 \fBgit-config\fR(1)),
4482 \fBgitattributes\fR(5)
4484 \fBgitmodules\fR(5))\&.
4486 Note that Git at the core level treats path names simply as sequences of non\-NUL bytes, there are no path name encoding conversions (except on Mac and Windows)\&. Therefore, using non\-ASCII path names will mostly work even on platforms and file systems that use legacy extended ASCII encodings\&. However, repositories created on such systems will not work properly on UTF\-8\-based systems (e\&.g\&. Linux, Mac, Windows) and vice versa\&. Additionally, many Git\-based tools simply assume path names to be UTF\-8 and will fail to display other encodings correctly\&.
4491 \h'-04'\(bu\h'+03'\c
4497 Commit log messages are typically encoded in UTF\-8, but other extended ASCII encodings are also supported\&. This includes ISO\-8859\-x, CP125x and many others, but
4499 UTF\-16/32, EBCDIC and CJK multi\-byte encodings (GBK, Shift\-JIS, Big5, EUC\-x, CP9xx etc\&.)\&.
4502 Although we encourage that the commit log messages are encoded in UTF\-8, both the core and Git Porcelain are designed not to force UTF\-8 on projects\&. If all participants of a particular project find it more convenient to use legacy encodings, Git does not forbid it\&. However, there are a few things to keep in mind\&.
4514 \fIgit commit\-tree\fR
4515 issue a warning if the commit log message given to it does not look like a valid UTF\-8 string, unless you explicitly say your project uses a legacy encoding\&. The way to say this is to have
4516 \fBi18n\&.commitEncoding\fR
4526 commitEncoding = ISO\-8859\-1
4532 Commit objects created with the above setting record the value of
4533 \fBi18n\&.commitEncoding\fR
4536 header\&. This is to help other people who look at them later\&. Lack of this header implies that the commit log message is encoded in UTF\-8\&.
4550 and friends look at the
4552 header of a commit object, and try to re\-code the log message into UTF\-8 unless otherwise specified\&. You can specify the desired output encoding with
4553 \fBi18n\&.logOutputEncoding\fR
4563 logOutputEncoding = ISO\-8859\-1
4569 If you do not have this configuration variable, the value of
4570 \fBi18n\&.commitEncoding\fR
4574 Note that we deliberately chose not to re\-code the commit log message when a commit is made to force UTF\-8 at the commit object level, because re\-coding to UTF\-8 is not necessarily a reversible operation\&.
4577 See \fBgit-config\fR(1) for core variables and \fBgit-diff\fR(1) for settings related to diff generation\&.
4584 \fIPretty Formats\fR
4585 above\&.) Defaults to
4589 i18n\&.logOutputEncoding
4591 Encoding to use when displaying logs\&. (See
4593 above\&.) Defaults to the value of
4594 \fBi18n\&.commitEncoding\fR
4595 if set, and UTF\-8 otherwise\&.
4598 Everything above this line in this section isn\(cqt included from the \fBgit-config\fR(1) documentation\&. The content that follows is the same as what\(cqs found there:
4604 \fBgit-show\fR(1), and
4605 \fBgit-whatchanged\fR(1)
4607 \fB\-\-abbrev\-commit\fR\&. You may override this option with
4608 \fB\-\-no\-abbrev\-commit\fR\&.
4613 Set the default date\-time mode for the
4615 command\&. Setting a value for log\&.date is similar to using
4622 If the format is set to "auto:foo" and the pager is in use, format "foo" will be used for the date format\&. Otherwise, "default" will be used\&.
4627 Print out the ref names of any commits that are shown by the log command\&. If
4629 is specified, the ref name prefixes
4634 will not be printed\&. If
4636 is specified, the full ref name (including prefix) will be printed\&. If
4638 is specified, then if the output is going to a terminal, the ref names are shown as if
4640 were given, otherwise no ref names are shown\&. This is the same as the
4646 log\&.initialDecorationSet
4650 only shows decorations for certain known ref namespaces\&. If
4652 is specified, then show all refs as decorations\&.
4655 log\&.excludeDecoration
4657 Exclude the specified patterns from the log decorations\&. This is similar to the
4658 \fB\-\-decorate\-refs\-exclude\fR
4659 command\-line option, but the config option can be overridden by the
4660 \fB\-\-decorate\-refs\fR
4666 Set diff format to be used when
4667 \fB\-\-diff\-merges=on\fR
4669 \fB\-\-diff\-merges\fR
4672 for details\&. Defaults to
4683 option was used when a single <path> is given\&. This has the same limitations as
4684 \fB\-\-follow\fR, i\&.e\&. it cannot be used to follow multiple files and does not work well on non\-linear history\&.
4689 A list of colors, separated by commas, that can be used to draw history lines in
4690 \fBgit log \-\-graph\fR\&.
4695 If true, the initial commit will be shown as a big creation event\&. This is equivalent to a diff against an empty tree\&. Tools like
4698 \fBgit-whatchanged\fR(1), which normally hide the root commit will now show it\&. True by default\&.
4705 \fBgit-show\fR(1), and
4706 \fBgit-whatchanged\fR(1)
4708 \fB\-\-show\-signature\fR\&.
4715 \fBgit-show\fR(1), and
4716 \fBgit-whatchanged\fR(1)
4718 \fB\-\-use\-mailmap\fR, otherwise assume
4719 \fB\-\-no\-use\-mailmap\fR\&. True by default\&.
4722 notes\&.mergeStrategy
4724 Which merge strategy to choose by default when resolving notes conflicts\&. Must be one of
4729 \fBcat_sort_uniq\fR\&. Defaults to
4730 \fBmanual\fR\&. See the "NOTES MERGE STRATEGIES" section of
4732 for more information on each strategy\&.
4734 This setting can be overridden by passing the
4737 \fBgit-notes\fR(1)\&.
4740 notes\&.<name>\&.mergeStrategy
4742 Which merge strategy to choose when doing a notes merge into refs/notes/<name>\&. This overrides the more general "notes\&.mergeStrategy"\&. See the "NOTES MERGE STRATEGIES" section in
4744 for more information on the available strategies\&.
4749 Which ref (or refs, if a glob or specified more than once), in addition to the default set by
4750 \fBcore\&.notesRef\fR
4752 \fBGIT_NOTES_REF\fR, to read notes from when showing commit messages with the
4754 family of commands\&.
4756 This setting can be overridden with the
4757 \fBGIT_NOTES_DISPLAY_REF\fR
4758 environment variable, which must be a colon separated list of refs or globs\&.
4760 A warning will be issued for refs that do not exist, but a glob that does not match any refs is silently ignored\&.
4762 This setting can be disabled by the
4766 family of commands, or by the
4767 \fB\-\-notes=<ref>\fR
4768 option accepted by those commands\&.
4770 The effective value of "core\&.notesRef" (possibly overridden by GIT_NOTES_REF) is also implicitly added to the list of refs to be displayed\&.
4773 notes\&.rewrite\&.<command>
4775 When rewriting commits with <command> (currently
4778 \fBrebase\fR), if this variable is
4779 \fBfalse\fR, git will not copy notes from the original to the rewritten commit\&. Defaults to
4780 \fBtrue\fR\&. See also "\fBnotes\&.rewriteRef\fR" below\&.
4782 This setting can be overridden with the
4783 \fBGIT_NOTES_REWRITE_REF\fR
4784 environment variable, which must be a colon separated list of refs or globs\&.
4789 When copying notes during a rewrite (see the "notes\&.rewrite\&.<command>" option), determines what to do if the target commit already has a note\&. Must be one of
4792 \fBcat_sort_uniq\fR, or
4793 \fBignore\fR\&. Defaults to
4794 \fBconcatenate\fR\&.
4796 This setting can be overridden with the
4797 \fBGIT_NOTES_REWRITE_MODE\fR
4798 environment variable\&.
4803 When copying notes during a rewrite, specifies the (fully qualified) ref whose notes should be copied\&. May be a glob, in which case notes in all matching refs will be copied\&. You may also specify this configuration several times\&.
4805 Does not have a default value; you must configure this variable to enable note rewriting\&. Set it to
4806 \fBrefs/notes/commits\fR
4807 to enable rewriting for the default commit notes\&.
4809 Can be overridden with the
4810 \fBGIT_NOTES_REWRITE_REF\fR
4811 environment variable\&. See
4812 \fBnotes\&.rewrite\&.<command>\fR
4813 above for a further description of its format\&.
4817 Part of the \fBgit\fR(1) suite