Autogenerated manpages for v2.44.0-548-g91ec36
[git-manpages.git] / man1 / git-replay.1
blob82d9cb0f333100f969bdd95f1d021c84d8b4a642
1 '\" t
2 .\"     Title: git-replay
3 .\"    Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2024-04-09
6 .\"    Manual: Git Manual
7 .\"    Source: Git 2.44.0.548.g91ec36f2cc
8 .\"  Language: English
9 .\"
10 .TH "GIT\-REPLAY" "1" "2024\-04\-09" "Git 2\&.44\&.0\&.548\&.g91ec36" "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 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 git-replay \- EXPERIMENTAL: Replay commits on a new base, works with bare repos too
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 (EXPERIMENTAL!) \fIgit replay\fR ([\-\-contained] \-\-onto <newbase> | \-\-advance <branch>) <revision\-range>\&...
36 .fi
37 .sp
38 .SH "DESCRIPTION"
39 .sp
40 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 update\-ref \-\-stdin\fR, which would update the relevant branches (see the OUTPUT section below)\&.
41 .sp
42 THIS COMMAND IS EXPERIMENTAL\&. THE BEHAVIOR MAY CHANGE\&.
43 .SH "OPTIONS"
44 .PP
45 \-\-onto <newbase>
46 .RS 4
47 Starting point at which to create the new commits\&. May be any valid commit, and not just an existing branch name\&.
48 .sp
49 When
50 \fB\-\-onto\fR
51 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
52 \fBgit rebase \-\-update\-refs\fR
53 updates multiple branches in the affected range\&.
54 .RE
55 .PP
56 \-\-advance <branch>
57 .RS 4
58 Starting point at which to create the new commits; must be a branch name\&.
59 .sp
60 When
61 \fB\-\-advance\fR
62 is specified, the update\-ref command(s) in the output will update the branch passed as an argument to
63 \fB\-\-advance\fR
64 to point at the new commits (in other words, this mimics a cherry\-pick operation)\&.
65 .RE
66 .PP
67 <revision\-range>
68 .RS 4
69 Range of commits to replay\&. More than one <revision\-range> can be passed, but in
70 \fB\-\-advance <branch>\fR
71 mode, they should have a single tip, so that it\(cqs clear where <branch> should point to\&. See "Specifying Ranges" in linkgit:git\-rev\-parse and the "Commit Limiting" options below\&.
72 .RE
73 .SS "Commit Limiting"
74 .sp
75 Besides specifying a range of commits that should be listed using the special notations explained in the description, additional commit limiting may be applied\&.
76 .sp
77 Using more options generally further limits the output (e\&.g\&. \fB\-\-since=<date1>\fR limits to commits newer than \fB<date1>\fR, and using it with \fB\-\-grep=<pattern>\fR further limits to commits whose log message has a line that matches \fB<pattern>\fR), unless otherwise noted\&.
78 .sp
79 Note that these are applied before commit ordering and formatting options, such as \fB\-\-reverse\fR\&.
80 .PP
81 \-<number>, \-n <number>, \-\-max\-count=<number>
82 .RS 4
83 Limit the number of commits to output\&.
84 .RE
85 .PP
86 \-\-skip=<number>
87 .RS 4
88 Skip
89 \fInumber\fR
90 commits before starting to show the commit output\&.
91 .RE
92 .PP
93 \-\-since=<date>, \-\-after=<date>
94 .RS 4
95 Show commits more recent than a specific date\&.
96 .RE
97 .PP
98 \-\-since\-as\-filter=<date>
99 .RS 4
100 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\&.
103 \-\-until=<date>, \-\-before=<date>
104 .RS 4
105 Show commits older than a specific date\&.
108 \-\-author=<pattern>, \-\-committer=<pattern>
109 .RS 4
110 Limit the commits output to ones with author/committer header lines that match the specified pattern (regular expression)\&. With more than one
111 \fB\-\-author=<pattern>\fR, commits whose author matches any of the given patterns are chosen (similarly for multiple
112 \fB\-\-committer=<pattern>\fR)\&.
115 \-\-grep\-reflog=<pattern>
116 .RS 4
117 Limit the commits output to ones with reflog entries that match the specified pattern (regular expression)\&. With more than one
118 \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
119 \fB\-\-walk\-reflogs\fR
120 is in use\&.
123 \-\-grep=<pattern>
124 .RS 4
125 Limit the commits output to ones with a log message that matches the specified pattern (regular expression)\&. With more than one
126 \fB\-\-grep=<pattern>\fR, commits whose message matches any of the given patterns are chosen (but see
127 \fB\-\-all\-match\fR)\&.
129 When
130 \fB\-\-notes\fR
131 is in effect, the message from the notes is matched as if it were part of the log message\&.
134 \-\-all\-match
135 .RS 4
136 Limit the commits output to ones that match all given
137 \fB\-\-grep\fR, instead of ones that match at least one\&.
140 \-\-invert\-grep
141 .RS 4
142 Limit the commits output to ones with a log message that do not match the pattern specified with
143 \fB\-\-grep=<pattern>\fR\&.
146 \-i, \-\-regexp\-ignore\-case
147 .RS 4
148 Match the regular expression limiting patterns without regard to letter case\&.
151 \-\-basic\-regexp
152 .RS 4
153 Consider the limiting patterns to be basic regular expressions; this is the default\&.
156 \-E, \-\-extended\-regexp
157 .RS 4
158 Consider the limiting patterns to be extended regular expressions instead of the default basic regular expressions\&.
161 \-F, \-\-fixed\-strings
162 .RS 4
163 Consider the limiting patterns to be fixed strings (don\(cqt interpret pattern as a regular expression)\&.
166 \-P, \-\-perl\-regexp
167 .RS 4
168 Consider the limiting patterns to be Perl\-compatible regular expressions\&.
170 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\&.
173 \-\-remove\-empty
174 .RS 4
175 Stop when a given path disappears from the tree\&.
178 \-\-merges
179 .RS 4
180 Print only merge commits\&. This is exactly the same as
181 \fB\-\-min\-parents=2\fR\&.
184 \-\-no\-merges
185 .RS 4
186 Do not print commits with more than one parent\&. This is exactly the same as
187 \fB\-\-max\-parents=1\fR\&.
190 \-\-min\-parents=<number>, \-\-max\-parents=<number>, \-\-no\-min\-parents, \-\-no\-max\-parents
191 .RS 4
192 Show only commits which have at least (or at most) that many parent commits\&. In particular,
193 \fB\-\-max\-parents=1\fR
194 is the same as
195 \fB\-\-no\-merges\fR,
196 \fB\-\-min\-parents=2\fR
197 is the same as
198 \fB\-\-merges\fR\&.
199 \fB\-\-max\-parents=0\fR
200 gives all root commits and
201 \fB\-\-min\-parents=3\fR
202 all octopus merges\&.
204 \fB\-\-no\-min\-parents\fR
206 \fB\-\-no\-max\-parents\fR
207 reset these limits (to no limit) again\&. Equivalent forms are
208 \fB\-\-min\-parents=0\fR
209 (any commit has 0 or more parents) and
210 \fB\-\-max\-parents=\-1\fR
211 (negative numbers denote no upper limit)\&.
214 \-\-first\-parent
215 .RS 4
216 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\&.
219 \-\-exclude\-first\-parent\-only
220 .RS 4
221 When finding commits to exclude (with a
222 \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\&.
225 \-\-not
226 .RS 4
227 Reverses the meaning of the
228 \fI^\fR
229 prefix (or lack thereof) for all following revision specifiers, up to the next
230 \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\&.
233 \-\-all
234 .RS 4
235 Pretend as if all the refs in
236 \fBrefs/\fR, along with
237 \fBHEAD\fR, are listed on the command line as
238 \fI<commit>\fR\&.
241 \-\-branches[=<pattern>]
242 .RS 4
243 Pretend as if all the refs in
244 \fBrefs/heads\fR
245 are listed on the command line as
246 \fI<commit>\fR\&. If
247 \fI<pattern>\fR
248 is given, limit branches to ones matching given shell glob\&. If pattern lacks
249 \fI?\fR,
250 \fI*\fR, or
251 \fI[\fR,
252 \fI/*\fR
253 at the end is implied\&.
256 \-\-tags[=<pattern>]
257 .RS 4
258 Pretend as if all the refs in
259 \fBrefs/tags\fR
260 are listed on the command line as
261 \fI<commit>\fR\&. If
262 \fI<pattern>\fR
263 is given, limit tags to ones matching given shell glob\&. If pattern lacks
264 \fI?\fR,
265 \fI*\fR, or
266 \fI[\fR,
267 \fI/*\fR
268 at the end is implied\&.
271 \-\-remotes[=<pattern>]
272 .RS 4
273 Pretend as if all the refs in
274 \fBrefs/remotes\fR
275 are listed on the command line as
276 \fI<commit>\fR\&. If
277 \fI<pattern>\fR
278 is given, limit remote\-tracking branches to ones matching given shell glob\&. If pattern lacks
279 \fI?\fR,
280 \fI*\fR, or
281 \fI[\fR,
282 \fI/*\fR
283 at the end is implied\&.
286 \-\-glob=<glob\-pattern>
287 .RS 4
288 Pretend as if all the refs matching shell glob
289 \fI<glob\-pattern>\fR
290 are listed on the command line as
291 \fI<commit>\fR\&. Leading
292 \fIrefs/\fR, is automatically prepended if missing\&. If pattern lacks
293 \fI?\fR,
294 \fI*\fR, or
295 \fI[\fR,
296 \fI/*\fR
297 at the end is implied\&.
300 \-\-exclude=<glob\-pattern>
301 .RS 4
302 Do not include refs matching
303 \fI<glob\-pattern>\fR
304 that the next
305 \fB\-\-all\fR,
306 \fB\-\-branches\fR,
307 \fB\-\-tags\fR,
308 \fB\-\-remotes\fR, or
309 \fB\-\-glob\fR
310 would otherwise consider\&. Repetitions of this option accumulate exclusion patterns up to the next
311 \fB\-\-all\fR,
312 \fB\-\-branches\fR,
313 \fB\-\-tags\fR,
314 \fB\-\-remotes\fR, or
315 \fB\-\-glob\fR
316 option (other options or arguments do not clear accumulated patterns)\&.
318 The patterns given should not begin with
319 \fBrefs/heads\fR,
320 \fBrefs/tags\fR, or
321 \fBrefs/remotes\fR
322 when applied to
323 \fB\-\-branches\fR,
324 \fB\-\-tags\fR, or
325 \fB\-\-remotes\fR, respectively, and they must begin with
326 \fBrefs/\fR
327 when applied to
328 \fB\-\-glob\fR
330 \fB\-\-all\fR\&. If a trailing
331 \fI/*\fR
332 is intended, it must be given explicitly\&.
335 \-\-exclude\-hidden=[fetch|receive|uploadpack]
336 .RS 4
337 Do not include refs that would be hidden by
338 \fBgit\-fetch\fR,
339 \fBgit\-receive\-pack\fR
341 \fBgit\-upload\-pack\fR
342 by consulting the appropriate
343 \fBfetch\&.hideRefs\fR,
344 \fBreceive\&.hideRefs\fR
346 \fBuploadpack\&.hideRefs\fR
347 configuration along with
348 \fBtransfer\&.hideRefs\fR
349 (see
350 \fBgit-config\fR(1))\&. This option affects the next pseudo\-ref option
351 \fB\-\-all\fR
353 \fB\-\-glob\fR
354 and is cleared after processing them\&.
357 \-\-reflog
358 .RS 4
359 Pretend as if all objects mentioned by reflogs are listed on the command line as
360 \fB<commit>\fR\&.
363 \-\-alternate\-refs
364 .RS 4
365 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
366 \fBobjects/info/alternates\fR\&. The set of included objects may be modified by
367 \fBcore\&.alternateRefsCommand\fR, etc\&. See
368 \fBgit-config\fR(1)\&.
371 \-\-single\-worktree
372 .RS 4
373 By default, all working trees will be examined by the following options when there are more than one (see
374 \fBgit-worktree\fR(1)):
375 \fB\-\-all\fR,
376 \fB\-\-reflog\fR
378 \fB\-\-indexed\-objects\fR\&. This option forces them to examine the current working tree only\&.
381 \-\-ignore\-missing
382 .RS 4
383 Upon seeing an invalid object name in the input, pretend as if the bad input was not given\&.
386 \-\-bisect
387 .RS 4
388 Pretend as if the bad bisection ref
389 \fBrefs/bisect/bad\fR
390 was listed and as if it was followed by
391 \fB\-\-not\fR
392 and the good bisection refs
393 \fBrefs/bisect/good\-*\fR
394 on the command line\&.
397 \-\-stdin
398 .RS 4
399 In addition to getting arguments from the command line, read them from standard input as well\&. This accepts commits and pseudo\-options like
400 \fB\-\-all\fR
402 \fB\-\-glob=\fR\&. When a
403 \fB\-\-\fR
404 separator is seen, the following input is treated as paths and used to limit the result\&. Flags like
405 \fB\-\-not\fR
406 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\&.
409 \-\-cherry\-mark
410 .RS 4
411 Like
412 \fB\-\-cherry\-pick\fR
413 (see below) but mark equivalent commits with
414 \fB=\fR
415 rather than omitting them, and inequivalent ones with
416 \fB+\fR\&.
419 \-\-cherry\-pick
420 .RS 4
421 Omit any commit that introduces the same change as another commit on the \(lqother side\(rq when the set of commits are limited with symmetric difference\&.
423 For example, if you have two branches,
424 \fBA\fR
426 \fBB\fR, a usual way to list all commits on only one side of them is with
427 \fB\-\-left\-right\fR
428 (see the example below in the description of the
429 \fB\-\-left\-right\fR
430 option)\&. However, it shows the commits that were cherry\-picked from the other branch (for example, \(lq3rd on b\(rq may be cherry\-picked from branch A)\&. With this option, such pairs of commits are excluded from the output\&.
433 \-\-left\-only, \-\-right\-only
434 .RS 4
435 List only commits on the respective side of a symmetric difference, i\&.e\&. only those which would be marked
436 \fB<\fR
437 resp\&.
438 \fB>\fR
440 \fB\-\-left\-right\fR\&.
442 For example,
443 \fB\-\-cherry\-pick \-\-right\-only A\&.\&.\&.B\fR
444 omits those commits from
445 \fBB\fR
446 which are in
447 \fBA\fR
448 or are patch\-equivalent to a commit in
449 \fBA\fR\&. In other words, this lists the
450 \fB+\fR
451 commits from
452 \fBgit cherry A B\fR\&. More precisely,
453 \fB\-\-cherry\-pick \-\-right\-only \-\-no\-merges\fR
454 gives the exact list\&.
457 \-\-cherry
458 .RS 4
459 A synonym for
460 \fB\-\-right\-only \-\-cherry\-mark \-\-no\-merges\fR; useful to limit the output to the commits on our side and mark those that have been applied to the other side of a forked history with
461 \fBgit log \-\-cherry upstream\&.\&.\&.mybranch\fR, similar to
462 \fBgit cherry upstream mybranch\fR\&.
465 \-g, \-\-walk\-reflogs
466 .RS 4
467 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,
468 \fI^commit\fR,
469 \fIcommit1\&.\&.commit2\fR, and
470 \fIcommit1\&.\&.\&.commit2\fR
471 notations cannot be used)\&.
473 With
474 \fB\-\-pretty\fR
475 format other than
476 \fBoneline\fR
478 \fBreference\fR
479 (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
480 \fBref@{<Nth>}\fR
481 (where
482 \fI<Nth>\fR
483 is the reverse\-chronological index in the reflog) or as
484 \fBref@{<timestamp>}\fR
485 (with the
486 \fI<timestamp>\fR
487 for that entry), depending on a few rules:
489 .RS 4
490 .ie n \{\
491 \h'-04' 1.\h'+01'\c
493 .el \{\
494 .sp -1
495 .IP "  1." 4.2
497 If the starting point is specified as
498 \fBref@{<Nth>}\fR, show the index format\&.
501 .RS 4
502 .ie n \{\
503 \h'-04' 2.\h'+01'\c
505 .el \{\
506 .sp -1
507 .IP "  2." 4.2
509 If the starting point was specified as
510 \fBref@{now}\fR, show the timestamp format\&.
513 .RS 4
514 .ie n \{\
515 \h'-04' 3.\h'+01'\c
517 .el \{\
518 .sp -1
519 .IP "  3." 4.2
521 If neither was used, but
522 \fB\-\-date\fR
523 was given on the command line, show the timestamp in the format requested by
524 \fB\-\-date\fR\&.
527 .RS 4
528 .ie n \{\
529 \h'-04' 4.\h'+01'\c
531 .el \{\
532 .sp -1
533 .IP "  4." 4.2
535 Otherwise, show the index format\&.
538 Under
539 \fB\-\-pretty=oneline\fR, the commit message is prefixed with this information on the same line\&. This option cannot be combined with
540 \fB\-\-reverse\fR\&. See also
541 \fBgit-reflog\fR(1)\&.
543 Under
544 \fB\-\-pretty=reference\fR, this information will not be shown at all\&.
547 \-\-merge
548 .RS 4
549 Show commits touching conflicted paths in the range
550 \fBHEAD\&.\&.\&.<other>\fR, where
551 \fB<other>\fR
552 is the first existing pseudoref in
553 \fBMERGE_HEAD\fR,
554 \fBCHERRY_PICK_HEAD\fR,
555 \fBREVERT_HEAD\fR
557 \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\&.
560 \-\-boundary
561 .RS 4
562 Output excluded boundary commits\&. Boundary commits are prefixed with
563 \fB\-\fR\&.
565 .SS "History Simplification"
567 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\&.
569 The following options select the commits to be shown:
571 <paths>
572 .RS 4
573 Commits modifying the given <paths> are selected\&.
576 \-\-simplify\-by\-decoration
577 .RS 4
578 Commits that are referred by some branch or tag are selected\&.
581 Note that extra commits can be shown to give a meaningful history\&.
583 The following options affect the way the simplification is performed:
585 Default mode
586 .RS 4
587 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)
590 \-\-show\-pulls
591 .RS 4
592 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\&.
595 \-\-full\-history
596 .RS 4
597 Same as the default mode, but does not prune some history\&.
600 \-\-dense
601 .RS 4
602 Only the selected commits are shown, plus some to have a meaningful history\&.
605 \-\-sparse
606 .RS 4
607 All commits in the simplified history are shown\&.
610 \-\-simplify\-merges
611 .RS 4
612 Additional option to
613 \fB\-\-full\-history\fR
614 to remove some needless merges from the resulting history, as there are no selected commits contributing to this merge\&.
617 \-\-ancestry\-path[=<commit>]
618 .RS 4
619 When given a range of commits to display (e\&.g\&.
620 \fIcommit1\&.\&.commit2\fR
622 \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
623 \fIcommit1\fR
624 (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\&.
627 A more detailed explanation follows\&.
629 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\&.)
631 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:
633 .if n \{\
634 .RS 4
637           \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
638          /     /   /   /   /   /
639         I     B   C   D   E   Y
640          \e   /   /   /   /   /
641           `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq   X
643 .if n \{\
648 The horizontal line of history A\-\-\-Q is taken to be the first parent of each merge\&. The commits are:
650 .RS 4
651 .ie n \{\
652 \h'-04'\(bu\h'+03'\c
654 .el \{\
655 .sp -1
656 .IP \(bu 2.3
658 \fBI\fR
659 is the initial commit, in which
660 \fBfoo\fR
661 exists with contents \(lqasdf\(rq, and a file
662 \fBquux\fR
663 exists with contents \(lqquux\(rq\&. Initial commits are compared to an empty tree, so
664 \fBI\fR
665 is !TREESAME\&.
668 .RS 4
669 .ie n \{\
670 \h'-04'\(bu\h'+03'\c
672 .el \{\
673 .sp -1
674 .IP \(bu 2.3
677 \fBA\fR,
678 \fBfoo\fR
679 contains just \(lqfoo\(rq\&.
682 .RS 4
683 .ie n \{\
684 \h'-04'\(bu\h'+03'\c
686 .el \{\
687 .sp -1
688 .IP \(bu 2.3
690 \fBB\fR
691 contains the same change as
692 \fBA\fR\&. Its merge
693 \fBM\fR
694 is trivial and hence TREESAME to all parents\&.
697 .RS 4
698 .ie n \{\
699 \h'-04'\(bu\h'+03'\c
701 .el \{\
702 .sp -1
703 .IP \(bu 2.3
705 \fBC\fR
706 does not change
707 \fBfoo\fR, but its merge
708 \fBN\fR
709 changes it to \(lqfoobar\(rq, so it is not TREESAME to any parent\&.
712 .RS 4
713 .ie n \{\
714 \h'-04'\(bu\h'+03'\c
716 .el \{\
717 .sp -1
718 .IP \(bu 2.3
720 \fBD\fR
721 sets
722 \fBfoo\fR
723 to \(lqbaz\(rq\&. Its merge
724 \fBO\fR
725 combines the strings from
726 \fBN\fR
728 \fBD\fR
729 to \(lqfoobarbaz\(rq; i\&.e\&., it is not TREESAME to any parent\&.
732 .RS 4
733 .ie n \{\
734 \h'-04'\(bu\h'+03'\c
736 .el \{\
737 .sp -1
738 .IP \(bu 2.3
740 \fBE\fR
741 changes
742 \fBquux\fR
743 to \(lqxyzzy\(rq, and its merge
744 \fBP\fR
745 combines the strings to \(lqquux xyzzy\(rq\&.
746 \fBP\fR
747 is TREESAME to
748 \fBO\fR, but not to
749 \fBE\fR\&.
752 .RS 4
753 .ie n \{\
754 \h'-04'\(bu\h'+03'\c
756 .el \{\
757 .sp -1
758 .IP \(bu 2.3
760 \fBX\fR
761 is an independent root commit that added a new file
762 \fBside\fR, and
763 \fBY\fR
764 modified it\&.
765 \fBY\fR
766 is TREESAME to
767 \fBX\fR\&. Its merge
768 \fBQ\fR
769 added
770 \fBside\fR
772 \fBP\fR, and
773 \fBQ\fR
774 is TREESAME to
775 \fBP\fR, but not to
776 \fBY\fR\&.
779 \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\&.
781 Default mode
782 .RS 4
783 Commits are included if they are not TREESAME to any parent (though this can be changed, see
784 \fB\-\-sparse\fR
785 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\&.
787 This results in:
789 .if n \{\
790 .RS 4
793           \&.\-A\-\-\-N\-\-\-O
794          /     /   /
795         I\-\-\-\-\-\-\-\-\-D
797 .if n \{\
801 Note how the rule to only follow the TREESAME parent, if one is available, removed
802 \fBB\fR
803 from consideration entirely\&.
804 \fBC\fR
805 was considered via
806 \fBN\fR, but is TREESAME\&. Root commits are compared to an empty tree, so
807 \fBI\fR
808 is !TREESAME\&.
810 Parent/child relations are only visible with
811 \fB\-\-parents\fR, but that does not affect the commits selected in default mode, so we have shown the parent lines\&.
814 \-\-full\-history without parent rewriting
815 .RS 4
816 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
818 .if n \{\
819 .RS 4
822         I  A  B  N  D  O  P  Q
824 .if n \{\
828 \fBM\fR
829 was excluded because it is TREESAME to both parents\&.
830 \fBE\fR,
831 \fBC\fR
833 \fBB\fR
834 were all walked, but only
835 \fBB\fR
836 was !TREESAME, so the others do not appear\&.
838 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\&.
841 \-\-full\-history with parent rewriting
842 .RS 4
843 Ordinary commits are only included if they are !TREESAME (though this can be changed, see
844 \fB\-\-sparse\fR
845 below)\&.
847 Merges are always included\&. However, their parent list is rewritten: Along each parent, prune away commits that are not included themselves\&. This results in
849 .if n \{\
850 .RS 4
853           \&.\-A\-\-\-M\-\-\-N\-\-\-O\-\-\-P\-\-\-Q
854          /     /   /   /   /
855         I     B   /   D   /
856          \e   /   /   /   /
857           `\-\-\-\-\-\-\-\-\-\-\-\-\-\*(Aq
859 .if n \{\
863 Compare to
864 \fB\-\-full\-history\fR
865 without rewriting above\&. Note that
866 \fBE\fR
867 was pruned away because it is TREESAME, but the parent list of P was rewritten to contain
868 \fBE\fR\*(Aqs parent
869 \fBI\fR\&. The same happened for
870 \fBC\fR
872 \fBN\fR, and
873 \fBX\fR,
874 \fBY\fR
876 \fBQ\fR\&.
879 In addition to the above settings, you can change whether TREESAME affects inclusion:
881 \-\-dense
882 .RS 4
883 Commits that are walked are included if they are not TREESAME to any parent\&.
886 \-\-sparse
887 .RS 4
888 All commits that are walked are included\&.
890 Note that without
891 \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\&.
894 \-\-simplify\-merges
895 .RS 4
896 First, build a history graph in the same way that
897 \fB\-\-full\-history\fR
898 with parent rewriting does (see above)\&.
900 Then simplify each commit
901 \fBC\fR
902 to its replacement
903 \fBC\*(Aq\fR
904 in the final history according to the following rules:
906 .RS 4
907 .ie n \{\
908 \h'-04'\(bu\h'+03'\c
910 .el \{\
911 .sp -1
912 .IP \(bu 2.3
915 \fBC\*(Aq\fR
917 \fBC\fR\&.
920 .RS 4
921 .ie n \{\
922 \h'-04'\(bu\h'+03'\c
924 .el \{\
925 .sp -1
926 .IP \(bu 2.3
928 Replace each parent
929 \fBP\fR
931 \fBC\*(Aq\fR
932 with its simplification
933 \fBP\*(Aq\fR\&. In the process, drop parents that are ancestors of other parents or that are root commits TREESAME to an empty tree, and remove duplicates, but take care to never drop all parents that we are TREESAME to\&.
936 .RS 4
937 .ie n \{\
938 \h'-04'\(bu\h'+03'\c
940 .el \{\
941 .sp -1
942 .IP \(bu 2.3
944 If after this parent rewriting,
945 \fBC\*(Aq\fR
946 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\&.
949 The effect of this is best shown by way of comparing to
950 \fB\-\-full\-history\fR
951 with parent rewriting\&. The example turns into:
953 .if n \{\
954 .RS 4
957           \&.\-A\-\-\-M\-\-\-N\-\-\-O
958          /     /       /
959         I     B       D
960          \e   /       /
961           `\-\-\-\-\-\-\-\-\-\*(Aq
963 .if n \{\
967 Note the major differences in
968 \fBN\fR,
969 \fBP\fR, and
970 \fBQ\fR
971 over
972 \fB\-\-full\-history\fR:
974 .RS 4
975 .ie n \{\
976 \h'-04'\(bu\h'+03'\c
978 .el \{\
979 .sp -1
980 .IP \(bu 2.3
982 \fBN\fR\*(Aqs parent list had
983 \fBI\fR
984 removed, because it is an ancestor of the other parent
985 \fBM\fR\&. Still,
986 \fBN\fR
987 remained because it is !TREESAME\&.
990 .RS 4
991 .ie n \{\
992 \h'-04'\(bu\h'+03'\c
994 .el \{\
995 .sp -1
996 .IP \(bu 2.3
998 \fBP\fR\*(Aqs parent list similarly had
999 \fBI\fR
1000 removed\&.
1001 \fBP\fR
1002 was then removed completely, because it had one parent and is TREESAME\&.
1005 .RS 4
1006 .ie n \{\
1007 \h'-04'\(bu\h'+03'\c
1009 .el \{\
1010 .sp -1
1011 .IP \(bu 2.3
1013 \fBQ\fR\*(Aqs parent list had
1014 \fBY\fR
1015 simplified to
1016 \fBX\fR\&.
1017 \fBX\fR
1018 was then removed, because it was a TREESAME root\&.
1019 \fBQ\fR
1020 was then removed completely, because it had one parent and is TREESAME\&.
1024 There is another simplification mode available:
1026 \-\-ancestry\-path[=<commit>]
1027 .RS 4
1028 Limit the displayed commits to those which are an ancestor of <commit>, or which are a descendant of <commit>, or are <commit> itself\&.
1030 As an example use case, consider the following commit history:
1032 .if n \{\
1033 .RS 4
1036             D\-\-\-E\-\-\-\-\-\-\-F
1037            /     \e       \e
1038           B\-\-\-C\-\-\-G\-\-\-H\-\-\-I\-\-\-J
1039          /                     \e
1040         A\-\-\-\-\-\-\-K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1042 .if n \{\
1046 A regular
1047 \fID\&.\&.M\fR
1048 computes the set of commits that are ancestors of
1049 \fBM\fR, but excludes the ones that are ancestors of
1050 \fBD\fR\&. This is useful to see what happened to the history leading to
1051 \fBM\fR
1052 since
1053 \fBD\fR, in the sense that \(lqwhat does
1054 \fBM\fR
1055 have that did not exist in
1056 \fBD\fR\(rq\&. The result in this example would be all the commits, except
1057 \fBA\fR
1059 \fBB\fR
1060 (and
1061 \fBD\fR
1062 itself, of course)\&.
1064 When we want to find out what commits in
1065 \fBM\fR
1066 are contaminated with the bug introduced by
1067 \fBD\fR
1068 and need fixing, however, we might want to view only the subset of
1069 \fID\&.\&.M\fR
1070 that are actually descendants of
1071 \fBD\fR, i\&.e\&. excluding
1072 \fBC\fR
1074 \fBK\fR\&. This is exactly what the
1075 \fB\-\-ancestry\-path\fR
1076 option does\&. Applied to the
1077 \fID\&.\&.M\fR
1078 range, it results in:
1080 .if n \{\
1081 .RS 4
1084                 E\-\-\-\-\-\-\-F
1085                  \e       \e
1086                   G\-\-\-H\-\-\-I\-\-\-J
1087                                \e
1088                                 L\-\-M
1090 .if n \{\
1094 We can also use
1095 \fB\-\-ancestry\-path=D\fR
1096 instead of
1097 \fB\-\-ancestry\-path\fR
1098 which means the same thing when applied to the
1099 \fID\&.\&.M\fR
1100 range but is just more explicit\&.
1102 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
1103 \fBD\&.\&.M\fR
1104 which contain that topic in their ancestry path\&. So, using
1105 \fB\-\-ancestry\-path=H D\&.\&.M\fR
1106 for example would result in:
1108 .if n \{\
1109 .RS 4
1112                 E
1113                  \e
1114                   G\-\-\-H\-\-\-I\-\-\-J
1115                                \e
1116                                 L\-\-M
1118 .if n \{\
1122 Whereas
1123 \fB\-\-ancestry\-path=K D\&.\&.M\fR
1124 would result in
1126 .if n \{\
1127 .RS 4
1130                 K\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-L\-\-M
1132 .if n \{\
1138 Before discussing another option, \fB\-\-show\-pulls\fR, we need to create a new example history\&.
1140 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:
1142 .if n \{\
1143 .RS 4
1146           \&.\-A\-\-\-M\-\-\-\-\-C\-\-N\-\-\-O\-\-\-P
1147          /     / \e  \e  \e/   /   /
1148         I     B   \e  R\-\*(Aq`\-Z\*(Aq   /
1149          \e   /     \e/         /
1150           \e /      /\e        /
1151            `\-\-\-X\-\-\*(Aq  `\-\-\-Y\-\-\*(Aq
1153 .if n \{\
1158 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\&.
1160 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:
1162 .if n \{\
1163 .RS 4
1166         I\-\-\-X
1168 .if n \{\
1173 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:
1175 .if n \{\
1176 .RS 4
1179           \&.\-A\-\-\-M\-\-\-\-\-\-\-\-N\-\-\-O\-\-\-P
1180          /     / \e  \e  \e/   /   /
1181         I     B   \e  R\-\*(Aq`\-\-\*(Aq   /
1182          \e   /     \e/         /
1183           \e /      /\e        /
1184            `\-\-\-X\-\-\*(Aq  `\-\-\-\-\-\-\*(Aq
1186 .if n \{\
1191 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\&.
1193 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:
1195 .if n \{\
1196 .RS 4
1199           \&.\-A\-\-\-M\-\-\&.
1200          /     /    \e
1201         I     B      R
1202          \e   /      /
1203           \e /      /
1204            `\-\-\-X\-\-\*(Aq
1206 .if n \{\
1211 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\&.
1213 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\&.
1215 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\&.
1217 \-\-show\-pulls
1218 .RS 4
1219 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\&.
1221 When a merge commit is included by
1222 \fB\-\-show\-pulls\fR, the merge is treated as if it "pulled" the change from another branch\&. When using
1223 \fB\-\-show\-pulls\fR
1224 on this example (and no other options) the resulting graph is:
1226 .if n \{\
1227 .RS 4
1230         I\-\-\-X\-\-\-R\-\-\-N
1232 .if n \{\
1236 Here, the merge commits
1237 \fBR\fR
1239 \fBN\fR
1240 are included because they pulled the commits
1241 \fBX\fR
1243 \fBR\fR
1244 into the base branch, respectively\&. These merges are the reason the commits
1245 \fBA\fR
1247 \fBB\fR
1248 do not appear in the default history\&.
1250 When
1251 \fB\-\-show\-pulls\fR
1252 is paired with
1253 \fB\-\-simplify\-merges\fR, the graph includes all of the necessary information:
1255 .if n \{\
1256 .RS 4
1259           \&.\-A\-\-\-M\-\-\&.   N
1260          /     /    \e /
1261         I     B      R
1262          \e   /      /
1263           \e /      /
1264            `\-\-\-X\-\-\*(Aq
1266 .if n \{\
1270 Notice that since
1271 \fBM\fR
1272 is reachable from
1273 \fBR\fR, the edge from
1274 \fBN\fR
1276 \fBM\fR
1277 was simplified away\&. However,
1278 \fBN\fR
1279 still appears in the history as an important commit because it "pulled" the change
1280 \fBR\fR
1281 into the main branch\&.
1284 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)\&.
1285 .SS "Commit Ordering"
1287 By default, the commits are shown in reverse chronological order\&.
1289 \-\-date\-order
1290 .RS 4
1291 Show no parents before all of its children are shown, but otherwise show commits in the commit timestamp order\&.
1294 \-\-author\-date\-order
1295 .RS 4
1296 Show no parents before all of its children are shown, but otherwise show commits in the author timestamp order\&.
1299 \-\-topo\-order
1300 .RS 4
1301 Show no parents before all of its children are shown, and avoid showing commits on multiple lines of history intermixed\&.
1303 For example, in a commit history like this:
1305 .if n \{\
1306 .RS 4
1309     \-\-\-1\-\-\-\-2\-\-\-\-4\-\-\-\-7
1310         \e              \e
1311          3\-\-\-\-5\-\-\-\-6\-\-\-\-8\-\-\-
1313 .if n \{\
1317 where the numbers denote the order of commit timestamps,
1318 \fBgit rev\-list\fR
1319 and friends with
1320 \fB\-\-date\-order\fR
1321 show the commits in the timestamp order: 8 7 6 5 4 3 2 1\&.
1323 With
1324 \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\&.
1327 \-\-reverse
1328 .RS 4
1329 Output the commits chosen to be shown (see Commit Limiting section above) in reverse order\&. Cannot be combined with
1330 \fB\-\-walk\-reflogs\fR\&.
1332 .SS "Object Traversal"
1334 These options are mostly targeted for packing of Git repositories\&.
1336 \-\-no\-walk[=(sorted|unsorted)]
1337 .RS 4
1338 Only show the given commits, but do not traverse their ancestors\&. This has no effect if a range is specified\&. If the argument
1339 \fBunsorted\fR
1340 is given, the commits are shown in the order they were given on the command line\&. Otherwise (if
1341 \fBsorted\fR
1342 or no argument was given), the commits are shown in reverse chronological order by commit time\&. Cannot be combined with
1343 \fB\-\-graph\fR\&.
1346 \-\-do\-walk
1347 .RS 4
1348 Overrides a previous
1349 \fB\-\-no\-walk\fR\&.
1351 .SS "Commit Formatting"
1353 \-\-pretty[=<format>], \-\-format=<format>
1354 .RS 4
1355 Pretty\-print the contents of the commit logs in a given format, where
1356 \fI<format>\fR
1357 can be one of
1358 \fIoneline\fR,
1359 \fIshort\fR,
1360 \fImedium\fR,
1361 \fIfull\fR,
1362 \fIfuller\fR,
1363 \fIreference\fR,
1364 \fIemail\fR,
1365 \fIraw\fR,
1366 \fIformat:<string>\fR
1368 \fItformat:<string>\fR\&. When
1369 \fI<format>\fR
1370 is none of the above, and has
1371 \fI%placeholder\fR
1372 in it, it acts as if
1373 \fI\-\-pretty=tformat:<format>\fR
1374 were given\&.
1376 See the "PRETTY FORMATS" section for some additional details for each format\&. When
1377 \fI=<format>\fR
1378 part is omitted, it defaults to
1379 \fImedium\fR\&.
1381 Note: you can specify the default pretty format in the repository configuration (see
1382 \fBgit-config\fR(1))\&.
1385 \-\-abbrev\-commit
1386 .RS 4
1387 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\&.
1389 This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
1392 \-\-no\-abbrev\-commit
1393 .RS 4
1394 Show the full 40\-byte hexadecimal commit object name\&. This negates
1395 \fB\-\-abbrev\-commit\fR, either explicit or implied by other options such as "\-\-oneline"\&. It also overrides the
1396 \fBlog\&.abbrevCommit\fR
1397 variable\&.
1400 \-\-oneline
1401 .RS 4
1402 This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
1405 \-\-encoding=<encoding>
1406 .RS 4
1407 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
1408 \fBX\fR
1409 and we are outputting in
1410 \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\&.
1413 \-\-expand\-tabs=<n>, \-\-expand\-tabs, \-\-no\-expand\-tabs
1414 .RS 4
1415 Perform a tab expansion (replace each tab with enough spaces to fill to the next display column that is a multiple of
1416 \fI<n>\fR) in the log message before showing it in the output\&.
1417 \fB\-\-expand\-tabs\fR
1418 is a short\-hand for
1419 \fB\-\-expand\-tabs=8\fR, and
1420 \fB\-\-no\-expand\-tabs\fR
1421 is a short\-hand for
1422 \fB\-\-expand\-tabs=0\fR, which disables tab expansion\&.
1424 By default, tabs are expanded in pretty formats that indent the log message by 4 spaces (i\&.e\&.
1425 \fImedium\fR, which is the default,
1426 \fIfull\fR, and
1427 \fIfuller\fR)\&.
1430 \-\-notes[=<ref>]
1431 .RS 4
1432 Show the notes (see
1433 \fBgit-notes\fR(1)) that annotate the commit, when showing the commit log message\&. This is the default for
1434 \fBgit log\fR,
1435 \fBgit show\fR
1437 \fBgit whatchanged\fR
1438 commands when there is no
1439 \fB\-\-pretty\fR,
1440 \fB\-\-format\fR, or
1441 \fB\-\-oneline\fR
1442 option given on the command line\&.
1444 By default, the notes shown are from the notes refs listed in the
1445 \fBcore\&.notesRef\fR
1447 \fBnotes\&.displayRef\fR
1448 variables (or corresponding environment overrides)\&. See
1449 \fBgit-config\fR(1)
1450 for more details\&.
1452 With an optional
1453 \fI<ref>\fR
1454 argument, use the ref to find the notes to display\&. The ref can specify the full refname when it begins with
1455 \fBrefs/notes/\fR; when it begins with
1456 \fBnotes/\fR,
1457 \fBrefs/\fR
1458 and otherwise
1459 \fBrefs/notes/\fR
1460 is prefixed to form the full name of the ref\&.
1462 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)\&.
1465 \-\-no\-notes
1466 .RS 4
1467 Do not show notes\&. This negates the above
1468 \fB\-\-notes\fR
1469 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"\&.
1472 \-\-show\-notes\-by\-default
1473 .RS 4
1474 Show the default notes unless options for displaying specific notes are given\&.
1477 \-\-show\-notes[=<ref>], \-\-[no\-]standard\-notes
1478 .RS 4
1479 These options are deprecated\&. Use the above \-\-notes/\-\-no\-notes options instead\&.
1482 \-\-show\-signature
1483 .RS 4
1484 Check the validity of a signed commit object by passing the signature to
1485 \fBgpg \-\-verify\fR
1486 and show the output\&.
1489 \-\-relative\-date
1490 .RS 4
1491 Synonym for
1492 \fB\-\-date=relative\fR\&.
1495 \-\-date=<format>
1496 .RS 4
1497 Only takes effect for dates shown in human\-readable format, such as when using
1498 \fB\-\-pretty\fR\&.
1499 \fBlog\&.date\fR
1500 config variable sets a default value for the log command\(cqs
1501 \fB\-\-date\fR
1502 option\&. By default, dates are shown in the original time zone (either committer\(cqs or author\(cqs)\&. If
1503 \fB\-local\fR
1504 is appended to the format (e\&.g\&.,
1505 \fBiso\-local\fR), the user\(cqs local time zone is used instead\&.
1507 \fB\-\-date=relative\fR
1508 shows dates relative to the current time, e\&.g\&. \(lq2 hours ago\(rq\&. The
1509 \fB\-local\fR
1510 option has no effect for
1511 \fB\-\-date=relative\fR\&.
1513 \fB\-\-date=local\fR
1514 is an alias for
1515 \fB\-\-date=default\-local\fR\&.
1517 \fB\-\-date=iso\fR
1519 \fB\-\-date=iso8601\fR) shows timestamps in a ISO 8601\-like format\&. The differences to the strict ISO 8601 format are:
1521 .RS 4
1522 .ie n \{\
1523 \h'-04'\(bu\h'+03'\c
1525 .el \{\
1526 .sp -1
1527 .IP \(bu 2.3
1529 a space instead of the
1530 \fBT\fR
1531 date/time delimiter
1534 .RS 4
1535 .ie n \{\
1536 \h'-04'\(bu\h'+03'\c
1538 .el \{\
1539 .sp -1
1540 .IP \(bu 2.3
1542 a space between time and time zone
1545 .RS 4
1546 .ie n \{\
1547 \h'-04'\(bu\h'+03'\c
1549 .el \{\
1550 .sp -1
1551 .IP \(bu 2.3
1553 no colon between hours and minutes of the time zone
1556 \fB\-\-date=iso\-strict\fR
1558 \fB\-\-date=iso8601\-strict\fR) shows timestamps in strict ISO 8601 format\&.
1560 \fB\-\-date=rfc\fR
1562 \fB\-\-date=rfc2822\fR) shows timestamps in RFC 2822 format, often found in email messages\&.
1564 \fB\-\-date=short\fR
1565 shows only the date, but not the time, in
1566 \fBYYYY\-MM\-DD\fR
1567 format\&.
1569 \fB\-\-date=raw\fR
1570 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
1571 \fB+\fR
1573 \fB\-\fR
1574 with four digits; the first two are hours, and the second two are minutes)\&. I\&.e\&., as if the timestamp were formatted with
1575 \fBstrftime("%s %z")\fR)\&. Note that the
1576 \fB\-local\fR
1577 option does not affect the seconds\-since\-epoch value (which is always measured in UTC), but does switch the accompanying timezone value\&.
1579 \fB\-\-date=human\fR
1580 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\&.
1582 \fB\-\-date=unix\fR
1583 shows the date as a Unix epoch timestamp (seconds since 1970)\&. As with
1584 \fB\-\-raw\fR, this is always in UTC and therefore
1585 \fB\-local\fR
1586 has no effect\&.
1588 \fB\-\-date=format:\&.\&.\&.\fR
1589 feeds the format
1590 \fB\&.\&.\&.\fR
1591 to your system
1592 \fBstrftime\fR, except for %s, %z, and %Z, which are handled internally\&. Use
1593 \fB\-\-date=format:%c\fR
1594 to show the date in your system locale\(cqs preferred format\&. See the
1595 \fBstrftime\fR
1596 manual for a complete list of format placeholders\&. When using
1597 \fB\-local\fR, the correct syntax is
1598 \fB\-\-date=format\-local:\&.\&.\&.\fR\&.
1600 \fB\-\-date=default\fR
1601 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\&.
1602 \fBThu Jan 1 00:00:00 1970 +0000\fR\&.
1605 \-\-parents
1606 .RS 4
1607 Print also the parents of the commit (in the form "commit parent\&...")\&. Also enables parent rewriting, see
1608 \fIHistory Simplification\fR
1609 above\&.
1612 \-\-children
1613 .RS 4
1614 Print also the children of the commit (in the form "commit child\&...")\&. Also enables parent rewriting, see
1615 \fIHistory Simplification\fR
1616 above\&.
1619 \-\-left\-right
1620 .RS 4
1621 Mark which side of a symmetric difference a commit is reachable from\&. Commits from the left side are prefixed with
1622 \fB<\fR
1623 and those from the right with
1624 \fB>\fR\&. If combined with
1625 \fB\-\-boundary\fR, those commits are prefixed with
1626 \fB\-\fR\&.
1628 For example, if you have this topology:
1630 .if n \{\
1631 .RS 4
1634              y\-\-\-b\-\-\-b  branch B
1635             / \e /
1636            /   \&.
1637           /   / \e
1638          o\-\-\-x\-\-\-a\-\-\-a  branch A
1640 .if n \{\
1644 you would get an output like this:
1646 .if n \{\
1647 .RS 4
1650         $ git rev\-list \-\-left\-right \-\-boundary \-\-pretty=oneline A\&.\&.\&.B
1652         >bbbbbbb\&.\&.\&. 3rd on b
1653         >bbbbbbb\&.\&.\&. 2nd on b
1654         <aaaaaaa\&.\&.\&. 3rd on a
1655         <aaaaaaa\&.\&.\&. 2nd on a
1656         \-yyyyyyy\&.\&.\&. 1st on b
1657         \-xxxxxxx\&.\&.\&. 1st on a
1659 .if n \{\
1665 \-\-graph
1666 .RS 4
1667 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
1668 \fB\-\-no\-walk\fR\&.
1670 This enables parent rewriting, see
1671 \fIHistory Simplification\fR
1672 above\&.
1674 This implies the
1675 \fB\-\-topo\-order\fR
1676 option by default, but the
1677 \fB\-\-date\-order\fR
1678 option may also be specified\&.
1681 \-\-show\-linear\-break[=<barrier>]
1682 .RS 4
1683 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
1684 \fB<barrier>\fR
1685 is specified, it is the string that will be shown instead of the default one\&.
1687 .SH "OUTPUT"
1689 When there are no conflicts, the output of this command is usable as input to \fBgit update\-ref \-\-stdin\fR\&. It is of the form:
1691 .if n \{\
1692 .RS 4
1695 update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
1696 update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
1697 update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}
1699 .if n \{\
1703 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)\&.
1704 .SH "EXIT STATUS"
1706 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\&.
1707 .SH "EXAMPLES"
1709 To simply rebase \fBmybranch\fR onto \fBtarget\fR:
1711 .if n \{\
1712 .RS 4
1715 $ git replay \-\-onto target origin/main\&.\&.mybranch
1716 update refs/heads/mybranch ${NEW_mybranch_HASH} ${OLD_mybranch_HASH}
1718 .if n \{\
1723 To cherry\-pick the commits from mybranch onto target:
1725 .if n \{\
1726 .RS 4
1729 $ git replay \-\-advance target origin/main\&.\&.mybranch
1730 update refs/heads/target ${NEW_target_HASH} ${OLD_target_HASH}
1732 .if n \{\
1737 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\&.
1739 What if you have a stack of branches, one depending upon another, and you\(cqd really like to rebase the whole set?
1741 .if n \{\
1742 .RS 4
1745 $ git replay \-\-contained \-\-onto origin/main origin/main\&.\&.tipbranch
1746 update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
1747 update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
1748 update refs/heads/tipbranch ${NEW_tipbranch_HASH} ${OLD_tipbranch_HASH}
1750 .if n \{\
1755 When calling \fBgit replay\fR, one does not need to specify a range of commits to replay using the syntax \fBA\&.\&.B\fR; any range expression will do:
1757 .if n \{\
1758 .RS 4
1761 $ git replay \-\-onto origin/main ^base branch1 branch2 branch3
1762 update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
1763 update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
1764 update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}
1766 .if n \{\
1771 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\&.
1772 .SH "GIT"
1774 Part of the \fBgit\fR(1) suite