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.305.g4083a6f052
10 .TH "GIT\-REPLAY" "1" "2024-11-20" "Git 2\&.47\&.0\&.305\&.g4083a6" "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-replay \- EXPERIMENTAL: Replay commits on a new base, works with bare repos too
35 (EXPERIMENTAL!) \fIgit replay\fR ([\-\-contained] \-\-onto <newbase> | \-\-advance <branch>) <revision\-range>\&...\:
39 Takes ranges of commits and replays them onto a new location\&. Leaves the working tree and the index untouched, and updates no references\&. The output of this command is meant to be used as input to \fBgit\fR \fBupdate\-ref\fR \fB\-\-stdin\fR, which would update the relevant branches (see the OUTPUT section below)\&.
41 THIS COMMAND IS EXPERIMENTAL\&. THE BEHAVIOR MAY CHANGE\&.
46 Starting point at which to create the new commits\&. May be any valid commit, and not just an existing branch name\&.
50 is specified, the update\-ref command(s) in the output will update the branch(es) in the revision range to point at the new commits, similar to the way how
53 \fB\-\-update\-refs\fR
54 updates multiple branches in the affected range\&.
59 Starting point at which to create the new commits; must be a branch name\&.
63 is specified, the update\-ref command(s) in the output will update the branch passed as an argument to
65 to point at the new commits (in other words, this mimics a cherry\-pick operation)\&.
70 Range of commits to replay\&. More than one <revision\-range> can be passed, but in
73 mode, they should have a single tip, so that it\(cqs clear where <branch> should point to\&. See "Specifying Ranges" in
74 \fBgit-rev-parse\fR(1)
75 and the "Commit Limiting" options below\&.
79 Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
81 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\&.
83 Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
85 \-<number>, \-n <number>, \-\-max\-count=<number>
87 Limit the number of commits to output\&.
94 commits before starting to show the commit output\&.
97 \-\-since=<date>, \-\-after=<date>
99 Show commits more recent than a specific date\&.
102 \-\-since\-as\-filter=<date>
104 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\&.
107 \-\-until=<date>, \-\-before=<date>
109 Show commits older than a specific date\&.
112 \-\-author=<pattern>, \-\-committer=<pattern>
114 Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
115 \fB\-\-author=\fR\fI<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
116 \fB\-\-committer=\fR\fI<pattern>\fR)\&.
119 \-\-grep\-reflog=<pattern>
121 Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
122 \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
123 \fB\-\-walk\-reflogs\fR
129 Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
130 \fB\-\-grep=\fR\fI<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
131 \fB\-\-all\-match\fR)\&.
135 is in effect, the message from the notes is matched as if it were part of the log message\&.
140 Limit the commits output to ones that match all given
141 \fB\-\-grep\fR, instead of ones that match at least one\&.
146 Limit the commits output to ones with a log message that do not match the pattern specified with
147 \fB\-\-grep=\fR\fI<pattern>\fR\&.
150 \-i, \-\-regexp\-ignore\-case
152 Match the regular expression limiting patterns without regard to letter case\&.
157 Consider the limiting patterns to be basic regular expressions; this is the default\&.
160 \-E, \-\-extended\-regexp
162 Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
165 \-F, \-\-fixed\-strings
167 Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
170 \-P, \-\-perl\-regexp
172 Consider the limiting patterns to be Perl\-compatible regular expressions\&.
174 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\&.
179 Stop when a given path disappears from the tree\&.
184 Print only merge commits\&. This is exactly the same as
185 \fB\-\-min\-parents=2\fR\&.
190 Do not print commits with more than one parent\&. This is exactly the same as
191 \fB\-\-max\-parents=1\fR\&.
194 \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
196 Show only commits which have at least (or at most) that many parent commits\&. In particular,
197 \fB\-\-max\-parents=1\fR
199 \fB\-\-no\-merges\fR,
200 \fB\-\-min\-parents=2\fR
203 \fB\-\-max\-parents=0\fR
204 gives all root commits and
205 \fB\-\-min\-parents=3\fR
206 all octopus merges\&.
208 \fB\-\-no\-min\-parents\fR
210 \fB\-\-no\-max\-parents\fR
211 reset these limits (to no limit) again\&. Equivalent forms are
212 \fB\-\-min\-parents=0\fR
213 (any commit has 0 or more parents) and
214 \fB\-\-max\-parents=\-1\fR
215 (negative numbers denote no upper limit)\&.
220 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\&.
223 \-\-exclude\-first\-parent\-only
225 When finding commits to exclude (with a
226 \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\&.
231 Reverses the meaning of the
233 prefix (or lack thereof) for all following revision specifiers, up to the next
234 \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\&.
239 Pretend as if all the refs in
240 \fBrefs/\fR, along with
241 \fBHEAD\fR, are listed on the command line as
245 \-\-branches[=<pattern>]
247 Pretend as if all the refs in
249 are listed on the command line as
252 is given, limit branches to ones matching given shell glob\&. If pattern lacks
257 at the end is implied\&.
262 Pretend as if all the refs in
264 are listed on the command line as
267 is given, limit tags to ones matching given shell glob\&. If pattern lacks
272 at the end is implied\&.
275 \-\-remotes[=<pattern>]
277 Pretend as if all the refs in
279 are listed on the command line as
282 is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
287 at the end is implied\&.
290 \-\-glob=<glob\-pattern>
292 Pretend as if all the refs matching shell glob
293 \fI<glob\-pattern>\fR
294 are listed on the command line as
295 \fI<commit>\fR\&. Leading
296 \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
301 at the end is implied\&.
304 \-\-exclude=<glob\-pattern>
306 Do not include refs matching
307 \fI<glob\-pattern>\fR
312 \fB\-\-remotes\fR, or
314 would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
318 \fB\-\-remotes\fR, or
320 option (other options or arguments do not clear accumulated patterns)\&.
322 The patterns given should not begin with
329 \fB\-\-remotes\fR, respectively, and they must begin with
334 \fB\-\-all\fR\&. If a trailing
336 is intended, it must be given explicitly\&.
339 \-\-exclude\-hidden=[fetch|receive|uploadpack]
341 Do not include refs that would be hidden by
343 \fBgit\-receive\-pack\fR
345 \fBgit\-upload\-pack\fR
346 by consulting the appropriate
347 \fBfetch\&.hideRefs\fR,
348 \fBreceive\&.hideRefs\fR
350 \fBuploadpack\&.hideRefs\fR
351 configuration along with
352 \fBtransfer\&.hideRefs\fR
354 \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
358 and is cleared after processing them\&.
363 Pretend as if all objects mentioned by reflogs are listed on the command line as
369 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
370 \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
371 \fBcore\&.alternateRefsCommand\fR, etc\&. See
372 \fBgit-config\fR(1)\&.
377 By default, all working trees will be examined by the following options when there are more than one (see
378 \fBgit-worktree\fR(1)):
382 \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
387 Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
392 Pretend as if the bad bisection ref
393 \fBrefs/bisect/bad\fR
394 was listed and as if it was followed by
396 and the good bisection refs
397 \fBrefs/bisect/good\-\fR* on the command line\&.
402 In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
405 \fB\-\-glob=\fR\&. When a
407 separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
409 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\&.
415 \fB\-\-cherry\-pick\fR
416 (see below) but mark equivalent commits with
418 rather than omitting them, and inequivalent ones with
424 Omit any commit that introduces the same change as another commit on the
426 when the set of commits are limited with symmetric difference\&.
428 For example, if you have two branches,
431 \fBB\fR, a usual way to list all commits on only one side of them is with
432 \fB\-\-left\-right\fR
433 (see the example below in the description of the
434 \fB\-\-left\-right\fR
435 option)\&. However, it shows the commits that were cherry\-picked from the other branch (for example,
437 may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
440 \-\-left\-only, \-\-right\-only
442 List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked < resp\&. > by
443 \fB\-\-left\-right\fR\&.
446 \fB\-\-cherry\-pick\fR
447 \fB\-\-right\-only\fR
448 \fBA\fR\fB\&.\&.\&.\fR\fBB\fR
449 omits those commits from
453 or are patch\-equivalent to a commit in
454 \fBA\fR\&. In other words, this lists the
460 \fBB\fR\&. More precisely,
461 \fB\-\-cherry\-pick\fR
462 \fB\-\-right\-only\fR
464 gives the exact list\&.
470 \fB\-\-right\-only\fR
471 \fB\-\-cherry\-mark\fR
472 \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
476 \fBupstream\fR\fB\&.\&.\&.\fR\fBmybranch\fR, similar to
483 \-g, \-\-walk\-reflogs
485 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,
487 \fIcommit1\&.\&.commit2\fR, and
488 \fIcommit1\&.\&.\&.commit2\fR
489 notations cannot be used)\&.
497 (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
498 \fBref@\fR{\fI<Nth>\fR} (where
500 is the reverse\-chronological index in the reflog) or as
501 \fBref@\fR{\fI<timestamp>\fR} (with the
503 for that entry), depending on a few rules:
513 If the starting point is specified as
514 \fBref@\fR{\fI<Nth>\fR}, show the index format\&.
525 If the starting point was specified as
526 \fBref@\fR{now}, show the timestamp format\&.
537 If neither was used, but
539 was given on the command line, show the timestamp in the format requested by
551 Otherwise, show the index format\&.
555 \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
556 \fB\-\-reverse\fR\&. See also
557 \fBgit-reflog\fR(1)\&.
560 \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
565 Show commits touching conflicted paths in the range
566 \fBHEAD\fR\fB\&.\&.\&.\fR\fI<other>\fR, where
568 is the first existing pseudoref in
570 \fBCHERRY_PICK_HEAD\fR,
573 \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\&.
578 Output excluded boundary commits\&. Boundary commits are prefixed with
581 .SS "History Simplification"
583 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\&.
585 The following options select the commits to be shown:
589 Commits modifying the given <paths> are selected\&.
592 \-\-simplify\-by\-decoration
594 Commits that are referred by some branch or tag are selected\&.
597 Note that extra commits can be shown to give a meaningful history\&.
599 The following options affect the way the simplification is performed:
603 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)
608 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\&.
613 Same as the default mode, but does not prune some history\&.
618 Only the selected commits are shown, plus some to have a meaningful history\&.
623 All commits in the simplified history are shown\&.
629 \fB\-\-full\-history\fR
630 to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
633 \-\-ancestry\-path[=<commit>]
635 When given a range of commits to display (e\&.g\&.
636 \fIcommit1\&.\&.commit2\fR
638 \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
640 (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\&.
643 A more detailed explanation follows\&.
645 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\&.)
647 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:
653 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
657 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq X
663 The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
674 is the initial commit, in which
677 \(lqasdf\(rq, and a file
680 \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
709 contains the same change as
712 is trivial and hence TREESAME to all parents\&.
725 \fBfoo\fR, but its merge
728 \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
743 \(lqbaz\(rq\&. Its merge
745 combines the strings from
750 \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
765 \(lqxyzzy\(rq, and its merge
767 combines the strings to
768 \(lqquux xyzzy\(rq\&.
784 is an independent root commit that added a new file
802 \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\&.
806 Commits are included if they are not TREESAME to any parent (though this can be changed, see
808 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\&.
824 Note how the rule to only follow the TREESAME parent, if one is available, removed
826 from consideration entirely\&.
829 \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
833 Parent/child relations are only visible with
834 \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
837 \-\-full\-history without parent rewriting
839 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
852 was excluded because it is TREESAME to both parents\&.
857 were all walked, but only
859 was !TREESAME, so the others do not appear\&.
861 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\&.
864 \-\-full\-history with parent rewriting
866 Ordinary commits are only included if they are !TREESAME (though this can be changed, see
870 Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
876 \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
880 `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
887 \fB\-\-full\-history\fR
888 without rewriting above\&. Note that
890 was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
892 \fBI\fR\&. The same happened for
902 In addition to the above settings, you can change whether TREESAME affects inclusion:
906 Commits that are walked are included if they are not TREESAME to any parent\&.
911 All commits that are walked are included\&.
914 \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\&.
919 First, build a history graph in the same way that
920 \fB\-\-full\-history\fR
921 with parent rewriting does (see above)\&.
923 Then simplify each commit
926 \fBC\fR\*(Aq in the final history according to the following rules:
952 \fBC\fR\*(Aq with its simplification
953 \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\&.
964 If after this parent rewriting,
965 \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\&.
968 The effect of this is best shown by way of comparing to
969 \fB\-\-full\-history\fR
970 with parent rewriting\&. The example turns into:
976 \&.\-A\-\-\-M\-\-\-N\-\-\-O
980 `\-\-\-\-\-\-\-\-\-\*(Aq
986 Note the major differences in
991 \fB\-\-full\-history\fR:
1001 \fBN\fR\*(Aqs parent list had
1003 removed, because it is an ancestor of the other parent
1006 remained because it is !TREESAME\&.
1011 \h'-04'\(bu\h'+03'\c
1017 \fBP\fR\*(Aqs parent list similarly had
1021 was then removed completely, because it had one parent and is TREESAME\&.
1026 \h'-04'\(bu\h'+03'\c
1032 \fBQ\fR\*(Aqs parent list had
1037 was then removed, because it was a TREESAME root\&.
1039 was then removed completely, because it had one parent and is TREESAME\&.
1043 There is another simplification mode available:
1045 \-\-ancestry\-path[=<commit>]
1047 Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
1049 As an example use case, consider the following commit history:
1055 D\-\-\-E\-\-\-\-\-\-\-F
1057 B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
1059 A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1067 computes the set of commits that are ancestors of
1068 \fBM\fR, but excludes the ones that are ancestors of
1069 \fBD\fR\&. This is useful to see what happened to the history leading to
1072 \fBD\fR, in the sense that
1073 \(lqwhat does \fBM\fR have that did not exist in \fBD\fR\(rq\&. The result in this example would be all the commits, except
1079 itself, of course)\&.
1081 When we want to find out what commits in
1083 are contaminated with the bug introduced by
1085 and need fixing, however, we might want to view only the subset of
1087 that are actually descendants of
1088 \fBD\fR, i\&.e\&. excluding
1091 \fBK\fR\&. This is exactly what the
1092 \fB\-\-ancestry\-path\fR
1093 option does\&. Applied to the
1095 range, it results in:
1103 G\-\-\-H\-\-\-I\-\-\-J
1112 \fB\-\-ancestry\-path=D\fR
1114 \fB\-\-ancestry\-path\fR
1115 which means the same thing when applied to the
1117 range but is just more explicit\&.
1119 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
1120 \fBD\fR\fB\&.\&.\fR\fBM\fR
1121 which contain that topic in their ancestry path\&. So, using
1122 \fB\-\-ancestry\-path=H\fR
1123 \fBD\fR\fB\&.\&.\fR\fBM\fR
1124 for example would result in:
1132 G\-\-\-H\-\-\-I\-\-\-J
1141 \fB\-\-ancestry\-path=K\fR
1142 \fBD\fR\fB\&.\&.\fR\fBM\fR
1149 K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1156 Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
1158 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:
1164 \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
1166 I B \e R\-\*(Aq`\-Z\*(Aq /
1169 `\-\-\-X\-\-\*(Aq `\-\-\-Y\-\-\*(Aq
1175 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\&.
1177 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:
1189 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:
1195 \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
1197 I B \e R\-\*(Aq`\-\-\*(Aq /
1200 `\-\-\-X\-\-\*(Aq `\-\-\-\-\-\-\*(Aq
1206 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\&.
1208 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:
1214 \&.\-A\-\-\-M\-\-\&.
1225 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\&.
1227 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\&.
1229 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\&.
1233 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\&.
1235 When a merge commit is included by
1236 \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
1237 \fB\-\-show\-pulls\fR
1238 on this example (and no other options) the resulting graph is:
1244 I\-\-\-X\-\-\-R\-\-\-N
1250 Here, the merge commits
1254 are included because they pulled the commits
1258 into the base branch, respectively\&. These merges are the reason the commits
1262 do not appear in the default history\&.
1265 \fB\-\-show\-pulls\fR
1267 \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
1273 \&.\-A\-\-\-M\-\-\&. N
1287 \fBR\fR, the edge from
1291 was simplified away\&. However,
1293 still appears in the history as an important commit because it "pulled" the change
1295 into the main branch\&.
1298 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)\&.
1299 .SS "Commit Ordering"
1301 By default, the commits are shown in reverse chronological order\&.
1305 Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order\&.
1308 \-\-author\-date\-order
1310 Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order\&.
1315 Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed\&.
1317 For example, in a commit history like this:
1323 \-\-\-1\-\-\-\-2\-\-\-\-4\-\-\-\-7
1325 3\-\-\-\-5\-\-\-\-6\-\-\-\-8\-\-\-
1331 where the numbers denote the order of commit timestamps,
1335 \fB\-\-date\-order\fR
1336 show the commits in the timestamp order: 8 7 6 5 4 3 2 1\&.
1339 \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\&.
1344 Output the commits chosen to be shown (see Commit Limiting section above) in reverse order\&. Cannot be combined with
1345 \fB\-\-walk\-reflogs\fR\&.
1347 .SS "Object Traversal"
1349 These options are mostly targeted for packing of Git repositories\&.
1351 \-\-no\-walk[=(sorted|unsorted)]
1353 Only show the given commits, but do not traverse their ancestors\&. This has no effect if a range is specified\&. If the argument
1355 is given, the commits are shown in the order they were given on the command line\&. Otherwise (if
1357 or no argument was given), the commits are shown in reverse chronological order by commit time\&. Cannot be combined with
1363 Overrides a previous
1364 \fB\-\-no\-walk\fR\&.
1366 .SS "Commit Formatting"
1368 \-\-pretty[=<format>], \-\-format=<format>
1370 Pretty\-print the contents of the commit logs in a given format, where
1381 \fIformat:<string>\fR
1383 \fItformat:<string>\fR\&. When
1385 is none of the above, and has
1387 in it, it acts as if
1388 \fI\-\-pretty=tformat:<format>\fR
1391 See the "PRETTY FORMATS" section for some additional details for each format\&. When
1393 part is omitted, it defaults to
1396 Note: you can specify the default pretty format in the repository configuration (see
1397 \fBgit-config\fR(1))\&.
1402 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\&.
1404 This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
1407 \-\-no\-abbrev\-commit
1409 Show the full 40\-byte hexadecimal commit object name\&. This negates
1410 \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as "\-\-oneline"\&. It also overrides the
1411 \fBlog\&.abbrevCommit\fR
1417 This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
1420 \-\-encoding=<encoding>
1422 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
1424 and we are outputting in
1425 \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\&.
1428 \-\-expand\-tabs=<n>, \-\-expand\-tabs, \-\-no\-expand\-tabs
1430 Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of
1431 \fI<n>\fR) in the log message before showing it in the output\&.
1432 \fB\-\-expand\-tabs\fR
1433 is a short\-hand for
1434 \fB\-\-expand\-tabs=8\fR, and
1435 \fB\-\-no\-expand\-tabs\fR
1436 is a short\-hand for
1437 \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&.
1439 By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&.
1440 \fImedium\fR, which is the default,
1448 \fBgit-notes\fR(1)) that annotate the commit, when showing the commit log message\&. This is the default for
1456 commands when there is no
1458 \fB\-\-format\fR, or
1460 option given on the command line\&.
1462 By default, the notes shown are from the notes refs listed in the
1463 \fBcore\&.notesRef\fR
1465 \fBnotes\&.displayRef\fR
1466 variables (or corresponding environment overrides)\&. See
1472 argument, use the ref to find the notes to display\&. The ref can specify the full refname when it begins with
1473 \fBrefs/notes/\fR; when it begins with
1478 is prefixed to form the full name of the ref\&.
1480 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)\&.
1485 Do not show notes\&. This negates the above
1487 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"\&.
1490 \-\-show\-notes\-by\-default
1492 Show the default notes unless options for displaying specific notes are given\&.
1495 \-\-show\-notes[=<ref>], \-\-[no\-]standard\-notes
1497 These options are deprecated\&. Use the above \-\-notes/\-\-no\-notes options instead\&.
1502 Check the validity of a signed commit object by passing the signature to
1505 and show the output\&.
1511 \fB\-\-date=relative\fR\&.
1516 Only takes effect for dates shown in human\-readable format, such as when using
1519 config variable sets a default value for the log command\(cqs
1521 option\&. By default, dates are shown in the original time zone (either committer\(cqs or author\(cqs)\&. If
1523 is appended to the format (e\&.g\&.,
1524 \fBiso\-local\fR), the user\(cqs local time zone is used instead\&.
1526 \fB\-\-date=relative\fR
1527 shows dates relative to the current time, e\&.g\&.
1528 \(lq2 hours ago\(rq\&. The
1530 option has no effect for
1531 \fB\-\-date=relative\fR\&.
1533 \fB\-\-date=local\fR
1535 \fB\-\-date=default\-local\fR\&.
1539 \fB\-\-date=iso8601\fR) shows timestamps in a ISO 8601\-like format\&. The differences to the strict ISO 8601 format are:
1543 \h'-04'\(bu\h'+03'\c
1549 a space instead of the
1556 \h'-04'\(bu\h'+03'\c
1562 a space between time and time zone
1567 \h'-04'\(bu\h'+03'\c
1573 no colon between hours and minutes of the time zone
1576 \fB\-\-date=iso\-strict\fR
1578 \fB\-\-date=iso8601\-strict\fR) shows timestamps in strict ISO 8601 format\&.
1582 \fB\-\-date=rfc2822\fR) shows timestamps in RFC 2822 format, often found in email messages\&.
1584 \fB\-\-date=short\fR
1585 shows only the date, but not the time, in
1590 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
1594 with four digits; the first two are hours, and the second two are minutes)\&. I\&.e\&., as if the timestamp were formatted with
1595 \fBstrftime\fR("%s %z"))\&. Note that the
1597 option does not affect the seconds\-since\-epoch value (which is always measured in UTC), but does switch the accompanying timezone value\&.
1599 \fB\-\-date=human\fR
1600 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\&.
1603 shows the date as a Unix epoch timestamp (seconds since 1970)\&. As with
1604 \fB\-\-raw\fR, this is always in UTC and therefore
1608 \fB\-\-date=format:\&.\&.\fR\&. feeds the format \&.\&.\&. to your system
1609 \fBstrftime\fR, except for %s, %z, and %Z, which are handled internally\&. Use
1610 \fB\-\-date=format:\fR%c to show the date in your system locale\(cqs preferred format\&. See the
1612 manual for a complete list of format placeholders\&. When using
1613 \fB\-local\fR, the correct syntax is
1614 \fB\-\-date=format\-local:\&.\&.\fR\&.\&.
1616 \fB\-\-date=default\fR
1617 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\&.
1628 Print also the parents of the commit (in the form "commit parent\&...\:")\&. Also enables parent rewriting, see
1629 \fIHistory Simplification\fR
1635 Print also the children of the commit (in the form "commit child\&...\:")\&. Also enables parent rewriting, see
1636 \fIHistory Simplification\fR
1642 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
1643 \fB\-\-boundary\fR, those commits are prefixed with
1646 For example, if you have this topology:
1652 y\-\-\-b\-\-\-b branch B
1656 o\-\-\-x\-\-\-a\-\-\-a branch A
1662 you would get an output like this:
1668 $ git rev\-list \-\-left\-right \-\-boundary \-\-pretty=oneline A\&.\&.\&.B
1670 >bbbbbbb\&.\&.\&. 3rd on b
1671 >bbbbbbb\&.\&.\&. 2nd on b
1672 <aaaaaaa\&.\&.\&. 3rd on a
1673 <aaaaaaa\&.\&.\&. 2nd on a
1674 \-yyyyyyy\&.\&.\&. 1st on b
1675 \-xxxxxxx\&.\&.\&. 1st on a
1684 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
1685 \fB\-\-no\-walk\fR\&.
1687 This enables parent rewriting, see
1688 \fIHistory Simplification\fR
1692 \fB\-\-topo\-order\fR
1693 option by default, but the
1694 \fB\-\-date\-order\fR
1695 option may also be specified\&.
1698 \-\-show\-linear\-break[=<barrier>]
1700 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
1702 is specified, it is the string that will be shown instead of the default one\&.
1706 When there are no conflicts, the output of this command is usable as input to \fBgit\fR \fBupdate\-ref\fR \fB\-\-stdin\fR\&. It is of the form:
1712 update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
1713 update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
1714 update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}
1720 where the number of refs updated depends on the arguments passed and the shape of the history being replayed\&. When using \fB\-\-advance\fR, the number of refs updated is always one, but for \fB\-\-onto\fR, it can be one or more (rebasing multiple branches simultaneously is supported)\&.
1723 For a successful, non\-conflicted replay, the exit status is 0\&. When the replay has conflicts, the exit status is 1\&. If the replay is not able to complete (or start) due to some kind of error, the exit status is something other than 0 or 1\&.
1726 To simply rebase \fBmybranch\fR onto \fBtarget\fR:
1732 $ git replay \-\-onto target origin/main\&.\&.mybranch
1733 update refs/heads/mybranch ${NEW_mybranch_HASH} ${OLD_mybranch_HASH}
1739 To cherry\-pick the commits from mybranch onto target:
1745 $ git replay \-\-advance target origin/main\&.\&.mybranch
1746 update refs/heads/target ${NEW_target_HASH} ${OLD_target_HASH}
1752 Note that the first two examples replay the exact same commits and on top of the exact same new base, they only differ in that the first provides instructions to make mybranch point at the new commits and the second provides instructions to make target point at them\&.
1754 What if you have a stack of branches, one depending upon another, and you\(cqd really like to rebase the whole set?
1760 $ git replay \-\-contained \-\-onto origin/main origin/main\&.\&.tipbranch
1761 update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
1762 update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
1763 update refs/heads/tipbranch ${NEW_tipbranch_HASH} ${OLD_tipbranch_HASH}
1769 When calling \fBgit\fR \fBreplay\fR, one does not need to specify a range of commits to replay using the syntax \fBA\fR\fB\&.\&.\fR\fBB\fR; any range expression will do:
1775 $ git replay \-\-onto origin/main ^base branch1 branch2 branch3
1776 update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
1777 update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
1778 update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}
1784 This will simultaneously rebase \fBbranch1\fR, \fBbranch2\fR, and \fBbranch3\fR, all commits they have since \fBbase\fR, playing them on top of \fBorigin/main\fR\&. These three branches may have commits on top of \fBbase\fR that they have in common, but that does not need to be the case\&.
1787 Part of the \fBgit\fR(1) suite