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.318.g04eaff62f2
10 .TH "GIT\-LOG" "1" "2024-11-22" "Git 2\&.47\&.0\&.318\&.g04eaff" "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)\&.
166 \fI<path>\fR\&.\&.\&. 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\&.
168 Note that this affects all diff\-based output types, e\&.g\&. those produced by
169 \fB\-\-stat\fR, etc\&.
175 \(lqlog size <number>\(rq
176 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
179 output by allowing them to allocate space in advance\&.
182 \-L<start>,<end>:<file>, \-L:<funcname>:<file>
184 Trace the evolution of the line range given by
185 \fI<start>,<end>\fR, or by the function name regex
186 \fI<funcname>\fR, within the
187 \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
192 \fI<funcname>\fR) must exist in the starting revision\&. You can specify this option more than once\&. Implies
193 \fB\-\-patch\fR\&. Patch output can be suppressed using
194 \fB\-\-no\-patch\fR, but other diff formats (namely
200 \fB\-\-name\-only\fR,
201 \fB\-\-name\-status\fR,
202 \fB\-\-check\fR) are not currently implemented\&.
207 can take one of these forms:
223 is a number, it specifies an absolute line number (lines count from 1)\&.
236 This form will use the first line matching the given POSIX regex\&. If
238 is a regex, it will search from the end of the previous
240 range, if any, otherwise from the start of file\&. If
243 \fB^/regex/\fR, it will search from the start of file\&. If
245 is a regex, it will search starting at the line given by
259 This is only valid for
261 and will specify a number of lines before or after the line given by
266 \fB:\fR\fI<funcname>\fR
270 \fI<end>\fR, it is a regular expression that denotes the range from the first funcname line that matches
271 \fI<funcname>\fR, up to the next funcname line\&.
272 \fB:\fR\fI<funcname>\fR
273 searches from the end of the previous
275 range, if any, otherwise from the start of file\&.
276 \fB^:\fR\fI<funcname>\fR
277 searches from the start of file\&. The function names are determined in the same way as
280 works out patch hunk headers (see
281 \fIDefining a custom hunk\-header\fR
283 \fBgitattributes\fR(5))\&.
288 Show only commits in the specified revision range\&. When no <revision\-range> is specified, it defaults to
290 (i\&.e\&. the whole history leading to the current commit)\&.
291 \fBorigin\fR\fB\&.\&.\fR\fBHEAD\fR
292 specifies all the commits reachable from the current commit (i\&.e\&.
293 \fBHEAD\fR), but not from
294 \fBorigin\fR\&. For a complete list of ways to spell <revision\-range>, see the
295 \fISpecifying Ranges\fR
297 \fBgitrevisions\fR(7)\&.
302 Show only commits that are enough to explain how the files that match the specified paths came to be\&. See
303 \fIHistory Simplification\fR
304 below for details and other simplification modes\&.
306 Paths may need to be prefixed with
308 to separate them from options or the revision range, when confusion arises\&.
310 .SS "Commit Limiting"
312 Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
314 Using more options generally further limits the output (e\&.g\&. \fB\-\-since=\fR\fI<date1>\fR limits to commits newer than \fI<date1>\fR, and using it with \fB\-\-grep=\fR\fI<pattern>\fR further limits to commits whose log message has a line that matches \fI<pattern>\fR), unless otherwise noted\&.
316 Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
318 \-<number>, \-n <number>, \-\-max\-count=<number>
320 Limit the number of commits to output\&.
327 commits before starting to show the commit output\&.
330 \-\-since=<date>, \-\-after=<date>
332 Show commits more recent than a specific date\&.
335 \-\-since\-as\-filter=<date>
337 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\&.
340 \-\-until=<date>, \-\-before=<date>
342 Show commits older than a specific date\&.
345 \-\-author=<pattern>, \-\-committer=<pattern>
347 Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
348 \fB\-\-author=\fR\fI<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
349 \fB\-\-committer=\fR\fI<pattern>\fR)\&.
352 \-\-grep\-reflog=<pattern>
354 Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
355 \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
356 \fB\-\-walk\-reflogs\fR
362 Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
363 \fB\-\-grep=\fR\fI<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
364 \fB\-\-all\-match\fR)\&.
368 is in effect, the message from the notes is matched as if it were part of the log message\&.
373 Limit the commits output to ones that match all given
374 \fB\-\-grep\fR, instead of ones that match at least one\&.
379 Limit the commits output to ones with a log message that do not match the pattern specified with
380 \fB\-\-grep=\fR\fI<pattern>\fR\&.
383 \-i, \-\-regexp\-ignore\-case
385 Match the regular expression limiting patterns without regard to letter case\&.
390 Consider the limiting patterns to be basic regular expressions; this is the default\&.
393 \-E, \-\-extended\-regexp
395 Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
398 \-F, \-\-fixed\-strings
400 Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
403 \-P, \-\-perl\-regexp
405 Consider the limiting patterns to be Perl\-compatible regular expressions\&.
407 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\&.
412 Stop when a given path disappears from the tree\&.
417 Print only merge commits\&. This is exactly the same as
418 \fB\-\-min\-parents=2\fR\&.
423 Do not print commits with more than one parent\&. This is exactly the same as
424 \fB\-\-max\-parents=1\fR\&.
427 \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
429 Show only commits which have at least (or at most) that many parent commits\&. In particular,
430 \fB\-\-max\-parents=1\fR
432 \fB\-\-no\-merges\fR,
433 \fB\-\-min\-parents=2\fR
436 \fB\-\-max\-parents=0\fR
437 gives all root commits and
438 \fB\-\-min\-parents=3\fR
439 all octopus merges\&.
441 \fB\-\-no\-min\-parents\fR
443 \fB\-\-no\-max\-parents\fR
444 reset these limits (to no limit) again\&. Equivalent forms are
445 \fB\-\-min\-parents=0\fR
446 (any commit has 0 or more parents) and
447 \fB\-\-max\-parents=\-1\fR
448 (negative numbers denote no upper limit)\&.
453 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\&.
455 This option also changes default diff format for merge commits to
456 \fBfirst\-parent\fR, see
457 \fB\-\-diff\-merges=first\-parent\fR
461 \-\-exclude\-first\-parent\-only
463 When finding commits to exclude (with a
464 \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\&.
469 Reverses the meaning of the
471 prefix (or lack thereof) for all following revision specifiers, up to the next
472 \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\&.
477 Pretend as if all the refs in
478 \fBrefs/\fR, along with
479 \fBHEAD\fR, are listed on the command line as
483 \-\-branches[=<pattern>]
485 Pretend as if all the refs in
487 are listed on the command line as
490 is given, limit branches to ones matching given shell glob\&. If pattern lacks
495 at the end is implied\&.
500 Pretend as if all the refs in
502 are listed on the command line as
505 is given, limit tags to ones matching given shell glob\&. If pattern lacks
510 at the end is implied\&.
513 \-\-remotes[=<pattern>]
515 Pretend as if all the refs in
517 are listed on the command line as
520 is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
525 at the end is implied\&.
528 \-\-glob=<glob\-pattern>
530 Pretend as if all the refs matching shell glob
531 \fI<glob\-pattern>\fR
532 are listed on the command line as
533 \fI<commit>\fR\&. Leading
534 \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
539 at the end is implied\&.
542 \-\-exclude=<glob\-pattern>
544 Do not include refs matching
545 \fI<glob\-pattern>\fR
550 \fB\-\-remotes\fR, or
552 would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
556 \fB\-\-remotes\fR, or
558 option (other options or arguments do not clear accumulated patterns)\&.
560 The patterns given should not begin with
567 \fB\-\-remotes\fR, respectively, and they must begin with
572 \fB\-\-all\fR\&. If a trailing
574 is intended, it must be given explicitly\&.
577 \-\-exclude\-hidden=[fetch|receive|uploadpack]
579 Do not include refs that would be hidden by
581 \fBgit\-receive\-pack\fR
583 \fBgit\-upload\-pack\fR
584 by consulting the appropriate
585 \fBfetch\&.hideRefs\fR,
586 \fBreceive\&.hideRefs\fR
588 \fBuploadpack\&.hideRefs\fR
589 configuration along with
590 \fBtransfer\&.hideRefs\fR
592 \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
596 and is cleared after processing them\&.
601 Pretend as if all objects mentioned by reflogs are listed on the command line as
607 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
608 \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
609 \fBcore\&.alternateRefsCommand\fR, etc\&. See
610 \fBgit-config\fR(1)\&.
615 By default, all working trees will be examined by the following options when there are more than one (see
616 \fBgit-worktree\fR(1)):
620 \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
625 Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
630 Pretend as if the bad bisection ref
631 \fBrefs/bisect/bad\fR
632 was listed and as if it was followed by
634 and the good bisection refs
635 \fBrefs/bisect/good\-\fR* on the command line\&.
640 In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
643 \fB\-\-glob=\fR\&. When a
645 separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
647 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\&.
653 \fB\-\-cherry\-pick\fR
654 (see below) but mark equivalent commits with
656 rather than omitting them, and inequivalent ones with
662 Omit any commit that introduces the same change as another commit on the
664 when the set of commits are limited with symmetric difference\&.
666 For example, if you have two branches,
669 \fBB\fR, a usual way to list all commits on only one side of them is with
670 \fB\-\-left\-right\fR
671 (see the example below in the description of the
672 \fB\-\-left\-right\fR
673 option)\&. However, it shows the commits that were cherry\-picked from the other branch (for example,
675 may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
678 \-\-left\-only, \-\-right\-only
680 List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked < resp\&. > by
681 \fB\-\-left\-right\fR\&.
684 \fB\-\-cherry\-pick\fR
685 \fB\-\-right\-only\fR
686 \fBA\fR\fB\&.\&.\&.\fR\fBB\fR
687 omits those commits from
691 or are patch\-equivalent to a commit in
692 \fBA\fR\&. In other words, this lists the
698 \fBB\fR\&. More precisely,
699 \fB\-\-cherry\-pick\fR
700 \fB\-\-right\-only\fR
702 gives the exact list\&.
708 \fB\-\-right\-only\fR
709 \fB\-\-cherry\-mark\fR
710 \fB\-\-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
714 \fBupstream\fR\fB\&.\&.\&.\fR\fBmybranch\fR, similar to
721 \-g, \-\-walk\-reflogs
723 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,
725 \fIcommit1\&.\&.commit2\fR, and
726 \fIcommit1\&.\&.\&.commit2\fR
727 notations cannot be used)\&.
735 (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
736 \fBref@\fR{\fI<Nth>\fR} (where
738 is the reverse\-chronological index in the reflog) or as
739 \fBref@\fR{\fI<timestamp>\fR} (with the
741 for that entry), depending on a few rules:
751 If the starting point is specified as
752 \fBref@\fR{\fI<Nth>\fR}, show the index format\&.
763 If the starting point was specified as
764 \fBref@\fR{now}, show the timestamp format\&.
775 If neither was used, but
777 was given on the command line, show the timestamp in the format requested by
789 Otherwise, show the index format\&.
793 \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
794 \fB\-\-reverse\fR\&. See also
795 \fBgit-reflog\fR(1)\&.
798 \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
803 Show commits touching conflicted paths in the range
804 \fBHEAD\fR\fB\&.\&.\&.\fR\fI<other>\fR, where
806 is the first existing pseudoref in
808 \fBCHERRY_PICK_HEAD\fR,
811 \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\&.
816 Output excluded boundary commits\&. Boundary commits are prefixed with
819 .SS "History Simplification"
821 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\&.
823 The following options select the commits to be shown:
827 Commits modifying the given <paths> are selected\&.
830 \-\-simplify\-by\-decoration
832 Commits that are referred by some branch or tag are selected\&.
835 Note that extra commits can be shown to give a meaningful history\&.
837 The following options affect the way the simplification is performed:
841 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)
846 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\&.
851 Same as the default mode, but does not prune some history\&.
856 Only the selected commits are shown, plus some to have a meaningful history\&.
861 All commits in the simplified history are shown\&.
867 \fB\-\-full\-history\fR
868 to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
871 \-\-ancestry\-path[=<commit>]
873 When given a range of commits to display (e\&.g\&.
874 \fIcommit1\&.\&.commit2\fR
876 \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
878 (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\&.
881 A more detailed explanation follows\&.
883 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\&.)
885 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:
891 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
895 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
901 The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
912 is the initial commit, in which
915 \(lqasdf\(rq, and a file
918 \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
947 contains the same change as
950 is trivial and hence TREESAME to all parents\&.
963 \fBfoo\fR, but its merge
966 \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
981 \(lqbaz\(rq\&. Its merge
983 combines the strings from
988 \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
1003 \(lqxyzzy\(rq, and its merge
1005 combines the strings to
1006 \(lqquux xyzzy\(rq\&.
1015 \h'-04'\(bu\h'+03'\c
1022 is an independent root commit that added a new file
1028 \fBX\fR\&. Its merge
1040 \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\&.
1044 Commits are included if they are not TREESAME to any parent (though this can be changed, see
1046 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\&.
1054 \&.\-A\-\-\-N\-\-\-O
1056 I\-\-\-\-\-\-\-\-\-D
1062 Note how the rule to only follow the TREESAME parent, if one is available, removed
1064 from consideration entirely\&.
1067 \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
1071 Parent/child relations are only visible with
1072 \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
1075 \-\-full\-history without parent rewriting
1077 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
1090 was excluded because it is TREESAME to both parents\&.
1095 were all walked, but only
1097 was !TREESAME, so the others do not appear\&.
1099 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\&.
1102 \-\-full\-history with parent rewriting
1104 Ordinary commits are only included if they are !TREESAME (though this can be changed, see
1108 Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
1114 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
1118 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
1125 \fB\-\-full\-history\fR
1126 without rewriting above\&. Note that
1128 was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
1129 \fBE\fR\*(Aqs parent
1130 \fBI\fR\&. The same happened for
1140 In addition to the above settings, you can change whether TREESAME affects inclusion:
1144 Commits that are walked are included if they are not TREESAME to any parent\&.
1149 All commits that are walked are included\&.
1152 \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\&.
1155 \-\-simplify\-merges
1157 First, build a history graph in the same way that
1158 \fB\-\-full\-history\fR
1159 with parent rewriting does (see above)\&.
1161 Then simplify each commit
1164 \fBC\fR\*(Aq in the final history according to the following rules:
1168 \h'-04'\(bu\h'+03'\c
1181 \h'-04'\(bu\h'+03'\c
1190 \fBC\fR\*(Aq with its simplification
1191 \fBP\fR\*(Aq\&. 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\&.
1196 \h'-04'\(bu\h'+03'\c
1202 If after this parent rewriting,
1203 \fBC\fR\*(Aq 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\&.
1206 The effect of this is best shown by way of comparing to
1207 \fB\-\-full\-history\fR
1208 with parent rewriting\&. The example turns into:
1214 \&.\-A\-\-\-M\-\-\-N\-\-\-O
1218 `\-\-\-\-\-\-\-\-\-\*(Aq
1224 Note the major differences in
1229 \fB\-\-full\-history\fR:
1233 \h'-04'\(bu\h'+03'\c
1239 \fBN\fR\*(Aqs parent list had
1241 removed, because it is an ancestor of the other parent
1244 remained because it is !TREESAME\&.
1249 \h'-04'\(bu\h'+03'\c
1255 \fBP\fR\*(Aqs parent list similarly had
1259 was then removed completely, because it had one parent and is TREESAME\&.
1264 \h'-04'\(bu\h'+03'\c
1270 \fBQ\fR\*(Aqs parent list had
1275 was then removed, because it was a TREESAME root\&.
1277 was then removed completely, because it had one parent and is TREESAME\&.
1281 There is another simplification mode available:
1283 \-\-ancestry\-path[=<commit>]
1285 Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
1287 As an example use case, consider the following commit history:
1293 D\-\-\-E\-\-\-\-\-\-\-F
1295 B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
1297 A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1305 computes the set of commits that are ancestors of
1306 \fBM\fR, but excludes the ones that are ancestors of
1307 \fBD\fR\&. This is useful to see what happened to the history leading to
1310 \fBD\fR, in the sense that
1311 \(lqwhat does \fBM\fR have that did not exist in \fBD\fR\(rq\&. The result in this example would be all the commits, except
1317 itself, of course)\&.
1319 When we want to find out what commits in
1321 are contaminated with the bug introduced by
1323 and need fixing, however, we might want to view only the subset of
1325 that are actually descendants of
1326 \fBD\fR, i\&.e\&. excluding
1329 \fBK\fR\&. This is exactly what the
1330 \fB\-\-ancestry\-path\fR
1331 option does\&. Applied to the
1333 range, it results in:
1341 G\-\-\-H\-\-\-I\-\-\-J
1350 \fB\-\-ancestry\-path=D\fR
1352 \fB\-\-ancestry\-path\fR
1353 which means the same thing when applied to the
1355 range but is just more explicit\&.
1357 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
1358 \fBD\fR\fB\&.\&.\fR\fBM\fR
1359 which contain that topic in their ancestry path\&. So, using
1360 \fB\-\-ancestry\-path=H\fR
1361 \fBD\fR\fB\&.\&.\fR\fBM\fR
1362 for example would result in:
1370 G\-\-\-H\-\-\-I\-\-\-J
1379 \fB\-\-ancestry\-path=K\fR
1380 \fBD\fR\fB\&.\&.\fR\fBM\fR
1387 K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1394 Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
1396 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:
1402 \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
1404 I B \e R\-\*(Aq`\-Z\*(Aq /
1407 `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
1413 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\&.
1415 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:
1427 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:
1433 \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
1435 I B \e R\-\*(Aq`\-\-\*(Aq /
1438 `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
1444 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\&.
1446 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:
1452 \&.\-A\-\-\-M\-\-\&.
1463 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\&.
1465 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\&.
1467 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\&.
1471 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\&.
1473 When a merge commit is included by
1474 \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
1475 \fB\-\-show\-pulls\fR
1476 on this example (and no other options) the resulting graph is:
1482 I\-\-\-X\-\-\-R\-\-\-N
1488 Here, the merge commits
1492 are included because they pulled the commits
1496 into the base branch, respectively\&. These merges are the reason the commits
1500 do not appear in the default history\&.
1503 \fB\-\-show\-pulls\fR
1505 \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
1511 \&.\-A\-\-\-M\-\-\&. N
1525 \fBR\fR, the edge from
1529 was simplified away\&. However,
1531 still appears in the history as an important commit because it "pulled" the change
1533 into the main branch\&.
1536 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)\&.
1537 .SS "Commit Ordering"
1539 By default, the commits are shown in reverse chronological order\&.
1543 Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order\&.
1546 \-\-author\-date\-order
1548 Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order\&.
1553 Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed\&.
1555 For example, in a commit history like this:
1561 \-\-\-1\-\-\-\-2\-\-\-\-4\-\-\-\-7
1563 3\-\-\-\-5\-\-\-\-6\-\-\-\-8\-\-\-
1569 where the numbers denote the order of commit timestamps,
1573 \fB\-\-date\-order\fR
1574 show the commits in the timestamp order: 8 7 6 5 4 3 2 1\&.
1577 \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\&.
1582 Output the commits chosen to be shown (see Commit Limiting section above) in reverse order\&. Cannot be combined with
1583 \fB\-\-walk\-reflogs\fR\&.
1585 .SS "Object Traversal"
1587 These options are mostly targeted for packing of Git repositories\&.
1589 \-\-no\-walk[=(sorted|unsorted)]
1591 Only show the given commits, but do not traverse their ancestors\&. This has no effect if a range is specified\&. If the argument
1593 is given, the commits are shown in the order they were given on the command line\&. Otherwise (if
1595 or no argument was given), the commits are shown in reverse chronological order by commit time\&. Cannot be combined with
1601 Overrides a previous
1602 \fB\-\-no\-walk\fR\&.
1604 .SS "Commit Formatting"
1606 \-\-pretty[=<format>], \-\-format=<format>
1608 Pretty\-print the contents of the commit logs in a given format, where
1619 \fIformat:<string>\fR
1621 \fItformat:<string>\fR\&. When
1623 is none of the above, and has
1625 in it, it acts as if
1626 \fI\-\-pretty=tformat:<format>\fR
1629 See the "PRETTY FORMATS" section for some additional details for each format\&. When
1631 part is omitted, it defaults to
1634 Note: you can specify the default pretty format in the repository configuration (see
1635 \fBgit-config\fR(1))\&.
1640 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\&.
1642 This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
1645 \-\-no\-abbrev\-commit
1647 Show the full 40\-byte hexadecimal commit object name\&. This negates
1648 \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as "\-\-oneline"\&. It also overrides the
1649 \fBlog\&.abbrevCommit\fR
1655 This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
1658 \-\-encoding=<encoding>
1660 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
1662 and we are outputting in
1663 \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\&.
1666 \-\-expand\-tabs=<n>, \-\-expand\-tabs, \-\-no\-expand\-tabs
1668 Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of
1669 \fI<n>\fR) in the log message before showing it in the output\&.
1670 \fB\-\-expand\-tabs\fR
1671 is a short\-hand for
1672 \fB\-\-expand\-tabs=8\fR, and
1673 \fB\-\-no\-expand\-tabs\fR
1674 is a short\-hand for
1675 \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&.
1677 By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&.
1678 \fImedium\fR, which is the default,
1686 \fBgit-notes\fR(1)) that annotate the commit, when showing the commit log message\&. This is the default for
1694 commands when there is no
1696 \fB\-\-format\fR, or
1698 option given on the command line\&.
1700 By default, the notes shown are from the notes refs listed in the
1701 \fBcore\&.notesRef\fR
1703 \fBnotes\&.displayRef\fR
1704 variables (or corresponding environment overrides)\&. See
1710 argument, use the ref to find the notes to display\&. The ref can specify the full refname when it begins with
1711 \fBrefs/notes/\fR; when it begins with
1716 is prefixed to form the full name of the ref\&.
1718 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)\&.
1723 Do not show notes\&. This negates the above
1725 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"\&.
1728 \-\-show\-notes\-by\-default
1730 Show the default notes unless options for displaying specific notes are given\&.
1733 \-\-show\-notes[=<ref>], \-\-[no\-]standard\-notes
1735 These options are deprecated\&. Use the above \-\-notes/\-\-no\-notes options instead\&.
1740 Check the validity of a signed commit object by passing the signature to
1743 and show the output\&.
1749 \fB\-\-date=relative\fR\&.
1754 Only takes effect for dates shown in human\-readable format, such as when using
1757 config variable sets a default value for the log command\(cqs
1759 option\&. By default, dates are shown in the original time zone (either committer\(cqs or author\(cqs)\&. If
1761 is appended to the format (e\&.g\&.,
1762 \fBiso\-local\fR), the user\(cqs local time zone is used instead\&.
1764 \fB\-\-date=relative\fR
1765 shows dates relative to the current time, e\&.g\&.
1766 \(lq2 hours ago\(rq\&. The
1768 option has no effect for
1769 \fB\-\-date=relative\fR\&.
1771 \fB\-\-date=local\fR
1773 \fB\-\-date=default\-local\fR\&.
1777 \fB\-\-date=iso8601\fR) shows timestamps in a ISO 8601\-like format\&. The differences to the strict ISO 8601 format are:
1781 \h'-04'\(bu\h'+03'\c
1787 a space instead of the
1794 \h'-04'\(bu\h'+03'\c
1800 a space between time and time zone
1805 \h'-04'\(bu\h'+03'\c
1811 no colon between hours and minutes of the time zone
1814 \fB\-\-date=iso\-strict\fR
1816 \fB\-\-date=iso8601\-strict\fR) shows timestamps in strict ISO 8601 format\&.
1820 \fB\-\-date=rfc2822\fR) shows timestamps in RFC 2822 format, often found in email messages\&.
1822 \fB\-\-date=short\fR
1823 shows only the date, but not the time, in
1828 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
1832 with four digits; the first two are hours, and the second two are minutes)\&. I\&.e\&., as if the timestamp were formatted with
1833 \fBstrftime\fR("%s %z"))\&. Note that the
1835 option does not affect the seconds\-since\-epoch value (which is always measured in UTC), but does switch the accompanying timezone value\&.
1837 \fB\-\-date=human\fR
1838 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\&.
1841 shows the date as a Unix epoch timestamp (seconds since 1970)\&. As with
1842 \fB\-\-raw\fR, this is always in UTC and therefore
1846 \fB\-\-date=format:\&.\&.\fR\&. feeds the format \&.\&.\&. to your system
1847 \fBstrftime\fR, except for %s, %z, and %Z, which are handled internally\&. Use
1848 \fB\-\-date=format:\fR%c to show the date in your system locale\(cqs preferred format\&. See the
1850 manual for a complete list of format placeholders\&. When using
1851 \fB\-local\fR, the correct syntax is
1852 \fB\-\-date=format\-local:\&.\&.\fR\&.\&.
1854 \fB\-\-date=default\fR
1855 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\&.
1866 Print also the parents of the commit (in the form "commit parent\&...\:")\&. Also enables parent rewriting, see
1867 \fIHistory Simplification\fR
1873 Print also the children of the commit (in the form "commit child\&...\:")\&. Also enables parent rewriting, see
1874 \fIHistory Simplification\fR
1880 Mark which side of a symmetric difference a commit is reachable from\&. Commits from the left side are prefixed with < and those from the right with >\&. If combined with
1881 \fB\-\-boundary\fR, those commits are prefixed with
1884 For example, if you have this topology:
1890 y\-\-\-b\-\-\-b branch B
1894 o\-\-\-x\-\-\-a\-\-\-a branch A
1900 you would get an output like this:
1906 $ git rev\-list \-\-left\-right \-\-boundary \-\-pretty=oneline A\&.\&.\&.B
1908 >bbbbbbb\&.\&.\&. 3rd on b
1909 >bbbbbbb\&.\&.\&. 2nd on b
1910 <aaaaaaa\&.\&.\&. 3rd on a
1911 <aaaaaaa\&.\&.\&. 2nd on a
1912 \-yyyyyyy\&.\&.\&. 1st on b
1913 \-xxxxxxx\&.\&.\&. 1st on a
1922 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
1923 \fB\-\-no\-walk\fR\&.
1925 This enables parent rewriting, see
1926 \fIHistory Simplification\fR
1930 \fB\-\-topo\-order\fR
1931 option by default, but the
1932 \fB\-\-date\-order\fR
1933 option may also be specified\&.
1936 \-\-show\-linear\-break[=<barrier>]
1938 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
1940 is specified, it is the string that will be shown instead of the default one\&.
1942 .SH "PRETTY FORMATS"
1944 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\&.
1946 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:
1950 \h'-04'\(bu\h'+03'\c
1962 <hash> <title\-line>
1968 This is designed to be as compact as possible\&.
1973 \h'-04'\(bu\h'+03'\c
2005 \h'-04'\(bu\h'+03'\c
2019 Date: <author\-date>
2039 <full\-commit\-message>
2048 \h'-04'\(bu\h'+03'\c
2082 <full\-commit\-message>
2091 \h'-04'\(bu\h'+03'\c
2105 AuthorDate: <author\-date>
2107 CommitDate: <committer\-date>
2127 <full\-commit\-message>
2136 \h'-04'\(bu\h'+03'\c
2148 <abbrev\-hash> (<title\-line>, <short\-author\-date>)
2154 This format is used to refer to another commit in a commit message and is the same as
2155 \fB\-\-pretty=\fR\*(Aqformat:%C(\fBauto\fR)%h (%s, %ad)\*(Aq\&. By default, the date is formatted with
2156 \fB\-\-date=short\fR
2159 option is explicitly specified\&. As with any
2161 with format placeholders, its output is not affected by other options like
2164 \fB\-\-walk\-reflogs\fR\&.
2169 \h'-04'\(bu\h'+03'\c
2183 Date: <author\-date>
2184 Subject: [PATCH] <title\-line>
2194 <full\-commit\-message>
2203 \h'-04'\(bu\h'+03'\c
2212 \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\&.
2217 \h'-04'\(bu\h'+03'\c
2227 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
2229 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
2232 \fB\-\-raw\fR\&. To get full object names in a raw diff format, use
2233 \fB\-\-no\-abbrev\fR\&.
2238 \h'-04'\(bu\h'+03'\c
2244 \fIformat:<format\-string>\fR
2247 \fIformat:<format\-string>\fR
2248 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
2254 \fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR
2255 would show something like this:
2261 The author of fe6e0ee was Junio C Hamano, 23 hours ago
2262 The title was >>t4119: test autocomputing \-p<n> for traditional diff input\&.<<
2268 The placeholders are:
2272 \h'-04'\(bu\h'+03'\c
2278 Placeholders that expand to a single literal character:
2294 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)\&.
2300 \h'-04'\(bu\h'+03'\c
2306 Placeholders that affect formatting of later placeholders:
2315 switch color to green
2320 switch color to blue
2330 color specification, as described under Values in the "CONFIGURATION FILE" section of
2331 \fBgit-config\fR(1)\&. By default, colors are shown only when enabled for log output (by
2333 \fBcolor\&.ui\fR, or
2334 \fB\-\-color\fR, and respecting the
2336 settings of the former if we are going to a terminal)\&. %C(\fBauto,\fR\fB\&.\&.\&.\fR) is accepted as a historical synonym for the default (e\&.g\&., %C(\fBauto,red\fR))\&. Specifying %C(\fBalways,\fR\fB\&.\&.\&.\fR) will show the colors even when color is not otherwise enabled (though consider just using
2337 \fB\-\-color=always\fR
2338 to enable color for the whole output, including this format and anything else git might color)\&.
2340 alone (i\&.e\&. %C(\fBauto\fR)) will turn on auto coloring on the next placeholders until the color is switched again\&.
2345 left (<), right (>) or boundary (\fB\-\fR) mark
2348 \fI%w([<w>[,<i1>[,<i2>]]])\fR
2350 switch line wrapping, like the \-w option of
2351 \fBgit-shortlog\fR(1)\&.
2354 \fI%<( <N> [,trunc|ltrunc|mtrunc])\fR
2356 make the next placeholder take at least N column widths, padding spaces on the right if necessary\&. Optionally truncate (with ellipsis
2357 \fI\&.\&.\fR) at the left (ltrunc)
2358 \fB\&.\&.\fR\fBft\fR, the middle (mtrunc)
2359 \fBmi\fR\fB\&.\&.\fR\fBle\fR, or the end (trunc)
2360 \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\&.
2365 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\&.
2368 \fI%>( <N> )\fR, \fI%>|( <M> )\fR
2373 respectively, but padding spaces on the left
2376 \fI%>>( <N> )\fR, \fI%>>|( <M> )\fR
2381 respectively, except that if the next placeholder takes more spaces than given and there are spaces on its left, use those spaces
2384 \fI%><( <N> )\fR, \fI%><|( <M> )\fR
2389 respectively, but padding both sides (i\&.e\&. the text is centered)
2395 \h'-04'\(bu\h'+03'\c
2401 Placeholders that expand to information extracted from the commit:
2410 abbreviated commit hash
2420 abbreviated tree hash
2430 abbreviated parent hashes
2440 author name (respecting \&.mailmap, see
2441 \fBgit-shortlog\fR(1)
2453 author email (respecting \&.mailmap, see
2454 \fBgit-shortlog\fR(1)
2461 author email local\-part (the part before the
2468 author local\-part (see
2469 \fI%al\fR) respecting \&.mailmap, see
2470 \fBgit-shortlog\fR(1)
2477 author date (format respects \-\-date= option)
2482 author date, RFC2822 style
2487 author date, relative
2492 author date, UNIX timestamp
2497 author date, ISO 8601\-like format
2502 author date, strict ISO 8601 format
2507 author date, short format (\fBYYYY\-MM\-DD\fR)
2512 author date, human style (like the
2513 \fB\-\-date=human\fR
2515 \fBgit-rev-list\fR(1))
2525 committer name (respecting \&.mailmap, see
2526 \fBgit-shortlog\fR(1)
2538 committer email (respecting \&.mailmap, see
2539 \fBgit-shortlog\fR(1)
2546 committer email local\-part (the part before the
2553 committer local\-part (see
2554 \fI%cl\fR) respecting \&.mailmap, see
2555 \fBgit-shortlog\fR(1)
2562 committer date (format respects \-\-date= option)
2567 committer date, RFC2822 style
2572 committer date, relative
2577 committer date, UNIX timestamp
2582 committer date, ISO 8601\-like format
2587 committer date, strict ISO 8601 format
2592 committer date, short format (\fBYYYY\-MM\-DD\fR)
2597 committer date, human style (like the
2598 \fB\-\-date=human\fR
2600 \fBgit-rev-list\fR(1))
2605 ref names, like the \-\-decorate option of
2611 ref names without the " (", ")" wrapping\&.
2614 \fI%(decorate[:<options>])\fR
2616 ref names with custom decorations\&. The
2618 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 (%x2C) and closing parentheses (%x29), due to their role in the option syntax\&.
2622 \h'-04'\(bu\h'+03'\c
2628 \fIprefix=<value>\fR: Shown before the list of ref names\&. Defaults to "\ \&("\&.
2633 \h'-04'\(bu\h'+03'\c
2639 \fIsuffix=<value>\fR: Shown after the list of ref names\&. Defaults to ")"\&.
2644 \h'-04'\(bu\h'+03'\c
2650 \fIseparator=<value>\fR: Shown between ref names\&. Defaults to "\fB,\fR\ \&"\&.
2655 \h'-04'\(bu\h'+03'\c
2661 \fIpointer=<value>\fR: Shown between HEAD and the branch it points to, if any\&. Defaults to "\ \&\fB\-\fR>\ \&"\&.
2666 \h'-04'\(bu\h'+03'\c
2672 \fItag=<value>\fR: Shown before tag names\&. Defaults to "\fBtag:\fR\ \&"\&.
2677 For example, to produce decorations with no wrapping or tag annotations, and spaces as separators:
2679 + %(\fBdecorate:prefix=,suffix=,tag=,separator=\fR
2682 \fI%(describe[:<options>])\fR
2684 human\-readable name, like
2685 \fBgit-describe\fR(1); empty string for undescribable commits\&. The
2687 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\&.
2691 \h'-04'\(bu\h'+03'\c
2697 \fItags[=<bool\-value>]\fR: Instead of only considering annotated tags, consider lightweight tags as well\&.
2702 \h'-04'\(bu\h'+03'\c
2708 \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\&.
2713 \h'-04'\(bu\h'+03'\c
2719 \fImatch=<pattern>\fR: Only consider tags matching the given
2720 \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
2725 \h'-04'\(bu\h'+03'\c
2731 \fIexclude=<pattern>\fR: Do not consider tags matching the given
2732 \fBglob\fR(\fB7\fR) pattern, excluding the "refs/tags/" prefix\&.
2738 ref name given on the command line by which the commit was reached (like
2741 \fB\-\-source\fR), only works with
2758 sanitized subject line, suitable for a filename
2768 raw body (unwrapped subject and body)
2778 raw verification message from GPG for a signed commit
2783 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
2788 show the name of the signer for a signed commit
2793 show the key used to sign a signed commit
2798 show the fingerprint of the key used to sign a signed commit
2803 show the fingerprint of the primary key whose subkey was used to sign a signed commit
2808 show the trust level for the key used to sign a signed commit
2813 reflog selector, e\&.g\&.,
2814 \fBrefs/stash@\fR{1} or
2817 \fBago\fR}; the format follows the rules described for the
2819 option\&. The portion before the
2821 is the refname as given on the command line (so
2825 \fBrefs/heads/master\fR
2827 \fBrefs/heads/master@\fR{0})\&.
2832 shortened reflog selector; same as %gD, but the refname portion is shortened for human readability (so
2833 \fBrefs/heads/master\fR
2840 reflog identity name
2845 reflog identity name (respecting \&.mailmap, see
2846 \fBgit-shortlog\fR(1)
2853 reflog identity email
2858 reflog identity email (respecting \&.mailmap, see
2859 \fBgit-shortlog\fR(1)
2869 \fI%(trailers[:<options>])\fR
2871 display the trailers of the body as interpreted by
2872 \fBgit-interpret-trailers\fR(1)\&. The
2874 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\&.
2878 \h'-04'\(bu\h'+03'\c
2884 \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
2886 option so that non\-trailer lines in the trailer block are hidden\&. If that is not desired it can be disabled with
2887 \fBonly=false\fR\&. E\&.g\&., %(\fBtrailers:key=Reviewed\-by\fR) shows trailer lines with key
2888 \fBReviewed\-by\fR\&.
2893 \h'-04'\(bu\h'+03'\c
2899 \fIonly[=<bool>]\fR: select whether non\-trailer lines from the trailer block should be included\&.
2904 \h'-04'\(bu\h'+03'\c
2910 \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 %x2C as it would otherwise be parsed as next option\&. E\&.g\&., %(\fBtrailers:key=Ticket,separator=\fR%x2C ) shows all trailer lines whose key is "Ticket" separated by a comma and a space\&.
2915 \h'-04'\(bu\h'+03'\c
2921 \fIunfold[=<bool>]\fR: make it behave as if interpret\-trailer\(cqs
2923 option was given\&. E\&.g\&., %(\fBtrailers:only,unfold=true\fR) unfolds and shows all trailer lines\&.
2928 \h'-04'\(bu\h'+03'\c
2934 \fIkeyonly[=<bool>]\fR: only show the key part of the trailer\&.
2939 \h'-04'\(bu\h'+03'\c
2945 \fIvalueonly[=<bool>]\fR: only show the value part of the trailer\&.
2950 \h'-04'\(bu\h'+03'\c
2956 \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
2957 \fIseparator=<sep>\fR
2967 .nr an-no-space-flag 1
2975 Some placeholders may depend on other options given to the revision traversal engine\&. For example, the %g* reflog options will insert an empty string unless we are traversing reflog entries (e\&.g\&., by \fBgit\fR \fBlog\fR \fB\-g\fR)\&. The %d and %D placeholders will use the "short" decoration format if \fB\-\-decorate\fR was not already provided on the command line\&.
2979 The boolean options accept an optional value [\fB=\fR\fI<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\&.
2981 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\&.
2983 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\&.
2985 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\&.
2989 \h'-04'\(bu\h'+03'\c
2999 format works exactly like
3000 \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:
3006 $ git log \-2 \-\-pretty=format:%h 4da45bef \e
3007 | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
3009 7134973 \-\- NO NEWLINE
3011 $ git log \-2 \-\-pretty=tformat:%h 4da45bef \e
3012 | perl \-pe \*(Aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\*(Aq
3020 In addition, any unrecognized string that has a % in it is interpreted as if it has
3022 in front of it\&. For example, these two are equivalent:
3028 $ git log \-2 \-\-pretty=tformat:%h 4da45bef
3029 $ git log \-2 \-\-pretty=%h 4da45bef
3035 .SH "DIFF FORMATTING"
3037 By default, \fBgit\fR \fBlog\fR does not generate any diff output\&. The options below can be used to show the changes made by each commit\&.
3039 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\&.
3044 the section called \(lqGENERATING PATCH TEXT WITH \-P\(rq)\&.
3049 Suppress all output from the diff machinery\&. Useful for commands like
3052 that show the patch by default to squelch their output, or to cancel the effect of options like
3055 earlier on the command line in an alias\&.
3060 Show diffs for merge commits in the default format\&. This is similar to
3061 \fI\-\-diff\-merges=on\fR, except
3063 will produce no output unless
3070 Produce combined diff output for merge commits\&. Shortcut for
3071 \fI\-\-diff\-merges=combined \-p\fR\&.
3076 Produce dense combined diff output for merge commits\&. Shortcut for
3077 \fI\-\-diff\-merges=dense\-combined \-p\fR\&.
3082 Produce diff with respect to first parent for both merge and regular commits\&. Shortcut for
3083 \fI\-\-diff\-merges=first\-parent \-p\fR\&.
3088 Produce remerge\-diff output for merge commits\&. Shortcut for
3089 \fI\-\-diff\-merges=remerge \-p\fR\&.
3092 \-\-no\-diff\-merges
3095 \fI\-\-diff\-merges=off\fR\&.
3098 \-\-diff\-merges=<format>
3100 Specify diff format to be used for merge commits\&. Default is `off` unless
3101 \fB\-\-first\-parent\fR
3102 is in use, in which case
3106 The following formats are supported:
3110 Disable output of diffs for merge commits\&. Useful to override implied value\&.
3115 Make diff output for merge commits to be shown in the default format\&. The default format can be changed using
3116 \fBlog\&.diffMerges\fR
3117 configuration variable, whose default value is
3123 Show full diff with respect to first parent\&. This is the same format as
3125 produces for non\-merge commits\&.
3130 Show full diff with respect to each of parents\&. Separate log entry and diff is generated for each parent\&.
3135 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\&.
3140 Further compress output produced by
3141 \fB\-\-diff\-merges=combined\fR
3142 by omitting uninteresting hunks whose contents in the parents have only two variants and the merge result picks one of them without modification\&.
3147 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\&.
3149 The output emitted when this option is used is subject to change, and so is its interaction with other options (unless explicitly documented)\&.
3153 \-\-combined\-all\-paths
3155 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
3156 \fB\-\-diff\-merges=\fR[\fBdense\-\fR]\fBcombined\fR
3157 is in use, and is likely only useful if filename changes are detected (i\&.e\&. when either rename or copy detection have been requested)\&.
3160 \-U<n>, \-\-unified=<n>
3162 Generate diffs with <n> lines of context instead of the usual three\&. Implies
3168 Output to a specific file instead of stdout\&.
3171 \-\-output\-indicator\-new=<char>, \-\-output\-indicator\-old=<char>, \-\-output\-indicator\-context=<char>
3173 Specify the character used to indicate new, old or context lines in the generated patch\&. Normally they are
3176 and \*(Aq \*(Aq respectively\&.
3181 For each commit, show a summary of changes using the raw diff format\&. See the "RAW OUTPUT FORMAT" section of
3182 \fBgit-diff\fR(1)\&. This is different from showing the log itself in raw format, which you can achieve with
3183 \fB\-\-format=raw\fR\&.
3186 \-\-patch\-with\-raw
3195 Show the tree objects in the diff output\&.
3198 \-\-indent\-heuristic
3200 Enable the heuristic that shifts diff hunk boundaries to make patches easier to read\&. This is the default\&.
3203 \-\-no\-indent\-heuristic
3205 Disable the indent heuristic\&.
3210 Spend extra time to make sure the smallest possible diff is produced\&.
3215 Generate a diff using the "patience diff" algorithm\&.
3220 Generate a diff using the "histogram diff" algorithm\&.
3225 Generate a diff using the "anchored diff" algorithm\&.
3227 This option may be specified more than once\&.
3229 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\&.
3232 \-\-diff\-algorithm={patience|minimal|histogram|myers}
3234 Choose a diff algorithm\&. The variants are as follows:
3236 \fBdefault\fR, \fBmyers\fR
3238 The basic greedy diff algorithm\&. Currently, this is the default\&.
3243 Spend extra time to make sure the smallest possible diff is produced\&.
3248 Use "patience diff" algorithm when generating patches\&.
3253 This algorithm extends the patience algorithm to "support low\-occurrence common elements"\&.
3256 For instance, if you configured the
3257 \fBdiff\&.algorithm\fR
3258 variable to a non\-default value and want to use the default one, then you have to use
3259 \fB\-\-diff\-algorithm=default\fR
3263 \-\-stat[=<width>[,<name\-width>[,<count>]]]
3265 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
3266 \fI<width>\fR\&. The width of the filename part can be limited by giving another width
3268 after a comma or by setting
3269 \fBdiff\&.statNameWidth=\fR\fI<width>\fR\&. The width of the graph part can be limited by using
3270 \fB\-\-stat\-graph\-width=\fR\fI<width>\fR
3272 \fBdiff\&.statGraphWidth=\fR\fI<width>\fR\&. Using
3275 \fB\-\-stat\-graph\-width\fR
3276 affects all commands generating a stat graph, while setting
3277 \fBdiff\&.statNameWidth\fR
3279 \fBdiff\&.statGraphWidth\fR
3282 \fBformat\-patch\fR\&. By giving a third parameter
3283 \fI<count>\fR, you can limit the output to the first
3285 lines, followed by \&.\&.\&. if there are more\&.
3287 These parameters can also be set individually with
3288 \fB\-\-stat\-width=\fR\fI<width>\fR,
3289 \fB\-\-stat\-name\-width=\fR\fI<name\-width>\fR
3291 \fB\-\-stat\-count=\fR\fI<count>\fR\&.
3294 \-\-compact\-summary
3296 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
3303 \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
3312 Output only the last line of the
3314 format containing total number of modified files, as well as number of added and deleted lines\&.
3317 \-X[<param1,param2,\&...\:>], \-\-dirstat[=<param1,param2,\&...\:>]
3319 Output the distribution of relative amount of changes for each sub\-directory\&. The behavior of
3321 can be customized by passing it a comma separated list of parameters\&. The defaults are controlled by the
3322 \fBdiff\&.dirstat\fR
3323 configuration variable (see
3324 \fBgit-config\fR(1))\&. The following parameters are available:
3328 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\&.
3333 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
3337 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
3338 \fB\-\-\fR*stat options\&.
3343 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
3345 behavior, since it does not have to look at the file contents at all\&.
3350 Count changes in a child directory for the parent directory as well\&. Note that when using
3351 \fBcumulative\fR, the sum of the percentages reported may exceed 100%\&. The default (non\-cumulative) behavior can be specified with the
3358 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\&.
3361 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:
3362 \fB\-\-dirstat=files,10,cumulative\fR\&.
3367 Synonym for \-\-dirstat=cumulative
3370 \-\-dirstat\-by\-file[=<param1,param2>\&...\:]
3372 Synonym for \-\-dirstat=files,<param1>,<param2>\&...\:
3377 Output a condensed summary of extended header information such as creations, renames and mode changes\&.
3380 \-\-patch\-with\-stat
3389 Separate the commits with NULs instead of newlines\&.
3395 has been given, do not munge pathnames and use NULs as output field terminators\&.
3397 Without this option, pathnames with "unusual" characters are quoted as explained for the configuration variable
3398 \fBcore\&.quotePath\fR
3400 \fBgit-config\fR(1))\&.
3405 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
3412 Show only the name(s) and status of each changed file\&. See the description of the
3413 \fB\-\-diff\-filter\fR
3414 option on what the status letters mean\&. Just like
3415 \fB\-\-name\-only\fR
3416 the file names are often encoded in UTF\-8\&.
3419 \-\-submodule[=<format>]
3421 Specify how differences in submodules are shown\&. When specifying
3422 \fB\-\-submodule=short\fR
3425 format is used\&. This format just shows the names of the commits at the beginning and end of the range\&. When
3428 \fB\-\-submodule=log\fR
3431 format is used\&. This format lists the commits in the range like
3432 \fBgit-submodule\fR(1)
3435 \fB\-\-submodule=diff\fR
3438 format is used\&. This format shows an inline diff of the changes in the submodule contents between the commit range\&. Defaults to
3439 \fBdiff\&.submodule\fR
3442 format if the config option is unset\&.
3447 Show colored diff\&.
3450 \fI=<when>\fR) is the same as
3451 \fB\-\-color=always\fR\&.
3461 Turn off colored diff\&. It is the same as
3462 \fB\-\-color=never\fR\&.
3465 \-\-color\-moved[=<mode>]
3467 Moved lines of code are colored differently\&. The <mode> defaults to
3469 if the option is not given and to
3471 if the option with no mode is given\&. The mode must be one of:
3475 Moved lines are not highlighted\&.
3481 \fBzebra\fR\&. This may change to a more sensible mode in the future\&.
3486 Any line that is added in one location and was removed in another location will be colored with
3487 \fIcolor\&.diff\&.newMoved\fR\&. Similarly
3488 \fIcolor\&.diff\&.oldMoved\fR
3489 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\&.
3494 Blocks of moved text of at least 20 alphanumeric characters are detected greedily\&. The detected blocks are painted using either the
3495 \fIcolor\&.diff\&.{old,new}Moved\fR
3496 color\&. Adjacent blocks cannot be told apart\&.
3501 Blocks of moved text are detected as in
3503 mode\&. The blocks are painted using either the
3504 \fIcolor\&.diff\&.{old,new}Moved\fR
3506 \fIcolor\&.diff\&.{old,new}MovedAlternative\fR\&. The change between the two colors indicates that a new block was detected\&.
3512 \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\&.
3514 is a deprecated synonym\&.
3518 \-\-no\-color\-moved
3520 Turn off move detection\&. This can be used to override configuration settings\&. It is the same as
3521 \fB\-\-color\-moved=no\fR\&.
3524 \-\-color\-moved\-ws=<modes>
3526 This configures how whitespace is ignored when performing the move detection for
3527 \fB\-\-color\-moved\fR\&. These modes can be given as a comma separated list:
3531 Do not ignore whitespace when performing move detection\&.
3534 ignore\-space\-at\-eol
3536 Ignore changes in whitespace at EOL\&.
3539 ignore\-space\-change
3541 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\&.
3546 Ignore whitespace when comparing lines\&. This ignores differences even if one line has whitespace where the other line has none\&.
3549 allow\-indentation\-change
3551 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\&.
3555 \-\-no\-color\-moved\-ws
3557 Do not ignore whitespace when performing move detection\&. This can be used to override configuration settings\&. It is the same as
3558 \fB\-\-color\-moved\-ws=no\fR\&.
3561 \-\-word\-diff[=<mode>]
3563 Show a word diff, using the <mode> to delimit changed words\&. By default, words are delimited by whitespace; see
3564 \fB\-\-word\-diff\-regex\fR
3565 below\&. The <mode> defaults to
3566 \fIplain\fR, and must be one of:
3570 Highlight changed words using only colors\&. Implies
3576 Show words as [\fB\-removed\-\fR] and {+added+}\&. Makes no attempts to escape the delimiters if they appear in the input, so the output may be ambiguous\&.
3581 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
3582 \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
3584 on a line of its own\&.
3589 Disable word diff again\&.
3592 Note that despite the name of the first mode, color is used to highlight the changed parts in all modes if enabled\&.
3595 \-\-word\-diff\-regex=<regex>
3597 Use <regex> to decide what a word is, instead of considering runs of non\-whitespace to be a word\&. Also implies
3598 \fB\-\-word\-diff\fR
3599 unless it was already enabled\&.
3601 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 |[\fB^\fR[\fB:space:\fR]] 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=\fR\fI<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=\fR\fI<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%)\&.
3695 \fB\-B/70\fR% 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)\&.
3697 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
3699 controls this aspect of the \-B option (defaults to 50%)\&.
3700 \fB\-B20\fR% 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\&.
3703 \-M[<n>], \-\-find\-renames[=<n>]
3705 If generating diffs, detect and report renames for each commit\&. For following files across renames while traversing history, see
3706 \fB\-\-follow\fR\&. If
3708 is specified, it is a threshold on the similarity index (i\&.e\&. amount of addition/deletions compared to the file\(cqs size)\&. For example,
3709 \fB\-M90\fR% means Git should consider a delete/add pair to be a rename if more than 90% of the file hasn\(cqt changed\&. Without a % sign, the number is to be read as a fraction, with a decimal point before it\&. I\&.e\&.,
3711 becomes 0\&.5, and is thus the same as
3712 \fB\-M50\fR%\&. Similarly,
3715 \fB\-M5\fR%\&. To limit detection to exact renames, use
3716 \fB\-M100\fR%\&. The default similarity index is 50%\&.
3719 \-C[<n>], \-\-find\-copies[=<n>]
3721 Detect copies as well as renames\&. See also
3722 \fB\-\-find\-copies\-harder\fR\&. If
3724 is specified, it has the same meaning as for
3725 \fB\-M\fR\fI<n>\fR\&.
3728 \-\-find\-copies\-harder
3730 For performance reasons, by default,
3732 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
3734 option has the same effect\&.
3737 \-D, \-\-irreversible\-delete
3739 Omit the preimage for deletes, i\&.e\&. print only the header but not the diff between the preimage and
3740 \fB/dev/null\fR\&. The resulting patch is not meant to be applied with
3744 \fBapply\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\&.
3746 When used together with
3747 \fB\-B\fR, omit also the preimage in the deletion part of a delete/create pair\&.
3756 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\&.
3759 \-\-diff\-filter=[(A|C|D|M|R|T|U|X|B)\&...\:[*]]
3761 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 * (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\&.
3763 Also, these upper\-case letters can be downcased to exclude\&. E\&.g\&.
3764 \fB\-\-diff\-filter=ad\fR
3765 excludes added and deleted paths\&.
3767 Note that not all diffs can feature all types\&. For instance, copied and renamed entries cannot appear if detection for those types is disabled\&.
3772 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\&.
3774 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
3775 \fB\-S\fR, and keep going until you get the very first version of the block\&.
3777 Binary files are searched as well\&.
3782 Look for differences whose patch text contains added/removed lines that match <regex>\&.
3784 To illustrate the difference between
3785 \fB\-S\fR\fI<regex>\fR
3786 \fB\-\-pickaxe\-regex\fR
3788 \fB\-G\fR\fI<regex>\fR, consider a commit with the following diff in the same file:
3794 + return frotz(nitfol, two\->ptr, 1, 0);
3796 \- hit = frotz(nitfol, mf2\&.ptr, 1, 0);
3805 \fB\-G\fR"frotz\e(\fBnitfol\fR" will show this commit,
3808 \fB\-S\fR"frotz\e(\fBnitfol\fR"
3809 \fB\-\-pickaxe\-regex\fR
3810 will not (because the number of occurrences of that string did not change)\&.
3814 is supplied patches of binary files without a textconv filter will be ignored\&.
3819 \fBgitdiffcore\fR(7)
3820 for more information\&.
3823 \-\-find\-object=<object\-id>
3825 Look for differences that change the number of occurrences of the specified object\&. Similar to
3826 \fB\-S\fR, just the argument is different in that it doesn\(cqt search for a specific string but for a specific object id\&.
3828 The object can be a blob or a submodule commit\&. It implies the
3832 to also find trees\&.
3841 finds a change, show all the changes in that changeset, not just the files that contain the change in <string>\&.
3846 Treat the <string> given to
3848 as an extended POSIX regular expression to match\&.
3853 Control the order in which files appear in the output\&. This overrides the
3854 \fBdiff\&.orderFile\fR
3855 configuration variable (see
3856 \fBgit-config\fR(1))\&. To cancel
3857 \fBdiff\&.orderFile\fR, use
3858 \fB\-O/dev/null\fR\&.
3860 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\&.
3862 <orderfile> is parsed as follows:
3866 \h'-04'\(bu\h'+03'\c
3872 Blank lines are ignored, so they can be used as separators for readability\&.
3877 \h'-04'\(bu\h'+03'\c
3883 Lines starting with a hash ("#") are ignored, so they can be used for comments\&. Add a backslash ("\e") to the beginning of the pattern if it starts with a hash\&.
3888 \h'-04'\(bu\h'+03'\c
3894 Each other line contains a single pattern\&.
3897 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\fR*bar" matches "\fBfooasdfbar\fR" and "\fBfoo/bar/baz/asdf\fR" but not "\fBfoobarx\fR"\&.
3900 \-\-skip\-to=<file>, \-\-rotate\-to=<file>
3902 Discard the files before the named <file> from the output (i\&.e\&.
3903 \fIskip to\fR), or move them to the end of the output (i\&.e\&.
3904 \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
3972 works out patch hunk headers (see
3973 \fIDefining a custom hunk\-header\fR
3975 \fBgitattributes\fR(5))\&.
3980 Allow an external diff helper to be executed\&. If you set an external diff driver with
3981 \fBgitattributes\fR(5), you need to use this option with
3988 Disallow external diff drivers\&.
3991 \-\-textconv, \-\-no\-textconv
3993 Allow (or disallow) external text conversion filters to be run when comparing binary files\&. See
3994 \fBgitattributes\fR(5)
3995 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
3998 \fBgit-log\fR(1), but not for
3999 \fBgit-format-patch\fR(1)
4000 or diff plumbing commands\&.
4003 \-\-ignore\-submodules[=<when>]
4005 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
4010 \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\&.
4013 \-\-src\-prefix=<prefix>
4015 Show the given source prefix instead of "a/"\&.
4018 \-\-dst\-prefix=<prefix>
4020 Show the given destination prefix instead of "b/"\&.
4025 Do not show any source or destination prefix\&.
4030 Use the default source and destination prefixes ("a/" and "b/")\&. This overrides configuration variables such as
4031 \fBdiff\&.noprefix\fR,
4032 \fBdiff\&.srcPrefix\fR,
4033 \fBdiff\&.dstPrefix\fR, and
4034 \fBdiff\&.mnemonicPrefix\fR
4036 \fBgit\-config\fR(1))\&.
4039 \-\-line\-prefix=<prefix>
4041 Prepend an additional prefix to every line of output\&.
4044 \-\-ita\-invisible\-in\-index
4046 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
4047 \fB\-\-ita\-visible\-in\-index\fR\&. Both options are experimental and could be removed in future\&.
4050 For more detailed explanation on these common options, see also \fBgitdiffcore\fR(7)\&.
4051 .SH "GENERATING PATCH TEXT WITH \-P"
4053 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))\&.
4055 What the \-p option produces is slightly different from the traditional diff format:
4065 It is preceded by a "git diff" header that looks like this:
4071 diff \-\-git a/file1 b/file2
4081 filenames are the same unless rename/copy is involved\&. Especially, even for a creation or a deletion,
4085 used in place of the
4091 When a rename/copy is involved,
4095 show the name of the source file of the rename/copy and the name of the file that the rename/copy produces, respectively\&.
4106 It is followed by one or more extended header lines:
4114 deleted file mode <mode>
4115 new file mode <mode>
4120 similarity index <number>
4121 dissimilarity index <number>
4122 index <hash>\&.\&.<hash> <mode>
4128 File modes are printed as 6\-digit octal numbers including the file type and file permission bits\&.
4130 Path names in extended headers do not include the
4136 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\&.
4138 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\&.
4149 Pathnames with "unusual" characters are quoted as explained for the configuration variable
4150 \fBcore\&.quotePath\fR
4152 \fBgit-config\fR(1))\&.
4165 files in the output refer to files before the commit, and all the
4167 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:
4173 diff \-\-git a/a b/b
4176 diff \-\-git a/b b/a
4193 Hunk headers mention the name of the function to which the hunk applies\&. See "Defining a custom hunk\-header" in
4194 \fBgitattributes\fR(5)
4195 for details of how to tailor this to specific languages\&.
4197 .SH "COMBINED DIFF FORMAT"
4199 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\&.
4201 A "combined diff" format looks like this:
4207 diff \-\-combined describe\&.c
4208 index fabadb8,cc95eb0\&.\&.4866510
4209 \-\-\- a/describe\&.c
4211 @@@ \-98,20 \-98,12 +98,20 @@@
4212 return (a_date > b_date) ? \-1 : (a_date == b_date) ? 0 : 1;
4215 \- static void describe(char *arg)
4216 \-static void describe(struct commit *cmit, int last_one)
4217 ++static void describe(char *arg, int last_one)
4219 + unsigned char sha1[20];
4220 + struct commit *cmit;
4221 struct commit_list *list;
4222 static int initialized = 0;
4223 struct commit_name *n;
4225 + if (get_sha1(arg, sha1) < 0)
4226 + usage(describe_usage);
4227 + cmit = lookup_commit_reference(sha1);
4229 + usage(describe_usage);
4233 for_each_ref(get_name);
4247 It is preceded by a "git diff" header, that looks like this (when the
4255 diff \-\-combined file
4261 or like this (when the
4284 It is followed by one or more extended header lines (this example shows a merge with two parents):
4290 index <hash>,<hash>\&.\&.<hash>
4291 mode <mode>,<mode>\&.\&.<mode>
4292 new file mode <mode>
4293 deleted file mode <mode>,<mode>
4301 \fI<mode>\fR\fB,\fR\fI<mode>\fR\fB\&.\&.\fR\fI<mode>\fR
4302 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\&.
4313 It is followed by a two\-line from\-file/to\-file header:
4326 Similar to the two\-line header for the traditional
4330 is used to signal created or deleted files\&.
4332 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:
4347 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\&.
4358 Chunk header format is modified to prevent people from accidentally feeding it to
4360 \fB\-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
4368 @@@ <from\-file\-range> <from\-file\-range> <to\-file\-range> @@@
4374 There are (number of parents + 1)
4376 characters in the chunk header for combined diff format\&.
4379 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 " " (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\&.
4381 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)\&.
4383 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)\&.
4385 When shown by \fBgit\fR \fBdiff\-tree\fR \fB\-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\fR \fBdiff\-files\fR \fB\-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")\&.
4388 \fBgit\fR \fBlog\fR \fB\-\-no\-merges\fR
4390 Show the whole commit history, but skip any merges
4393 \fBgit\fR \fBlog\fR \fBv2\&.6\&.12\fR\fB\&.\&.\fR \fBinclude/scsi\fR \fBdrivers/scsi\fR
4395 Show all commits since version
4397 that changed any file in the
4404 \fBgit\fR \fBlog\fR \fB\-\-since=\fR"2 \fBweeks\fR \fBago\fR" \fB\-\-\fR \fBgitk\fR
4406 Show the changes during the last two weeks to the file
4409 is necessary to avoid confusion with the
4415 \fBgit\fR \fBlog\fR \fB\-\-name\-status\fR \fBrelease\fR\fB\&.\&.\fR\fBtest\fR
4417 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\&.
4420 \fBgit\fR \fBlog\fR \fB\-\-follow\fR \fBbuiltin/rev\-list\&.c\fR
4422 Shows the commits that changed
4423 \fBbuiltin/rev\-list\&.c\fR, including those commits that occurred before the file was given its present name\&.
4426 \fBgit\fR \fBlog\fR \fB\-\-branches\fR \fB\-\-not\fR \fB\-\-remotes=origin\fR
4428 Shows all commits that are in any of local branches but not in any of remote\-tracking branches for
4430 (what you have that origin doesn\(cqt)\&.
4433 \fBgit\fR \fBlog\fR \fBmaster\fR \fB\-\-not\fR \fB\-\-remotes=\fR*/master
4435 Shows all commits that are in local master but not in any remote repository master branches\&.
4438 \fBgit\fR \fBlog\fR \fB\-p\fR \fB\-m\fR \fB\-\-first\-parent\fR
4440 Shows the history including change diffs, but only from the
4442 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\&.
4445 \fBgit\fR \fBlog\fR \fB\-L\fR \*(Aq/int \fBmain/\fR\*(Aq,/^}/:main\&.\fBc\fR
4447 Shows how the function
4448 \fBmain\fR() in the file
4450 evolved over time\&.
4453 \fBgit\fR \fBlog\fR \fB\-3\fR
4455 Limits the number of commits to show to 3\&.
4459 Git is to some extent character encoding agnostic\&.
4463 \h'-04'\(bu\h'+03'\c
4469 The contents of the blob objects are uninterpreted sequences of bytes\&. There is no encoding translation at the core level\&.
4474 \h'-04'\(bu\h'+03'\c
4480 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 (\&.\fBgit/config\fR
4482 \fBgit-config\fR(1)),
4484 \fBgitattributes\fR(5)
4486 \fBgitmodules\fR(5))\&.
4488 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\&.
4493 \h'-04'\(bu\h'+03'\c
4499 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
4501 UTF\-16/32, EBCDIC and CJK multi\-byte encodings (GBK, Shift\-JIS, Big5, EUC\-x, CP9xx etc\&.)\&.
4504 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\&.
4516 \fIgit commit\-tree\fR
4517 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
4518 \fBi18n\&.commitEncoding\fR
4519 in \&.\fBgit/config\fR
4527 commitEncoding = ISO\-8859\-1
4533 Commit objects created with the above setting record the value of
4534 \fBi18n\&.commitEncoding\fR
4537 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\&.
4551 and friends look at the
4553 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
4554 \fBi18n\&.logOutputEncoding\fR
4555 in \&.\fBgit/config\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
4647 log\&.initialDecorationSet
4652 only shows decorations for certain known ref namespaces\&. If
4654 is specified, then show all refs as decorations\&.
4657 log\&.excludeDecoration
4659 Exclude the specified patterns from the log decorations\&. This is similar to the
4660 \fB\-\-decorate\-refs\-exclude\fR
4661 command\-line option, but the config option can be overridden by the
4662 \fB\-\-decorate\-refs\fR
4668 Set diff format to be used when
4669 \fB\-\-diff\-merges=on\fR
4671 \fB\-\-diff\-merges\fR
4674 for details\&. Defaults to
4686 option was used when a single <path> is given\&. This has the same limitations as
4687 \fB\-\-follow\fR, i\&.e\&. it cannot be used to follow multiple files and does not work well on non\-linear history\&.
4692 A list of colors, separated by commas, that can be used to draw history lines in
4700 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
4703 \fBgit-whatchanged\fR(1), which normally hide the root commit will now show it\&. True by default\&.
4710 \fBgit-show\fR(1), and
4711 \fBgit-whatchanged\fR(1)
4713 \fB\-\-show\-signature\fR\&.
4720 \fBgit-show\fR(1), and
4721 \fBgit-whatchanged\fR(1)
4723 \fB\-\-use\-mailmap\fR, otherwise assume
4724 \fB\-\-no\-use\-mailmap\fR\&. True by default\&.
4727 notes\&.mergeStrategy
4729 Which merge strategy to choose by default when resolving notes conflicts\&. Must be one of
4734 \fBcat_sort_uniq\fR\&. Defaults to
4735 \fBmanual\fR\&. See the "NOTES MERGE STRATEGIES" section of
4737 for more information on each strategy\&.
4739 This setting can be overridden by passing the
4742 \fBgit-notes\fR(1)\&.
4745 notes\&.<name>\&.mergeStrategy
4747 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
4749 for more information on the available strategies\&.
4754 Which ref (or refs, if a glob or specified more than once), in addition to the default set by
4755 \fBcore\&.notesRef\fR
4757 \fBGIT_NOTES_REF\fR, to read notes from when showing commit messages with the
4759 family of commands\&.
4761 This setting can be overridden with the
4762 \fBGIT_NOTES_DISPLAY_REF\fR
4763 environment variable, which must be a colon separated list of refs or globs\&.
4765 A warning will be issued for refs that do not exist, but a glob that does not match any refs is silently ignored\&.
4767 This setting can be disabled by the
4771 family of commands, or by the
4772 \fB\-\-notes=\fR\fI<ref>\fR
4773 option accepted by those commands\&.
4775 The effective value of "core\&.notesRef" (possibly overridden by GIT_NOTES_REF) is also implicitly added to the list of refs to be displayed\&.
4778 notes\&.rewrite\&.<command>
4780 When rewriting commits with <command> (currently
4783 \fBrebase\fR), if this variable is
4784 \fBfalse\fR, git will not copy notes from the original to the rewritten commit\&. Defaults to
4785 \fBtrue\fR\&. See also "\fBnotes\&.rewriteRef\fR" below\&.
4787 This setting can be overridden with the
4788 \fBGIT_NOTES_REWRITE_REF\fR
4789 environment variable, which must be a colon separated list of refs or globs\&.
4794 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
4797 \fBcat_sort_uniq\fR, or
4798 \fBignore\fR\&. Defaults to
4799 \fBconcatenate\fR\&.
4801 This setting can be overridden with the
4802 \fBGIT_NOTES_REWRITE_MODE\fR
4803 environment variable\&.
4808 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\&.
4810 Does not have a default value; you must configure this variable to enable note rewriting\&. Set it to
4811 \fBrefs/notes/commits\fR
4812 to enable rewriting for the default commit notes\&.
4814 Can be overridden with the
4815 \fBGIT_NOTES_REWRITE_REF\fR
4816 environment variable\&. See
4817 \fBnotes\&.rewrite\&.\fR\fI<command>\fR
4818 above for a further description of its format\&.
4822 Part of the \fBgit\fR(1) suite