9
SYNOPSIS
10
--------
11
[verse]
12
-(EXPERIMENTAL!) 'git replay' --onto <newbase> <oldbase> <branch>
12
+(EXPERIMENTAL!) 'git replay' --onto <newbase> <revision-range>...
13
14
DESCRIPTION
15
-----------
16
17
-Takes a range of commits, specified by <oldbase> and <branch>, and
18
-replays them onto a new location (see `--onto` option below). Leaves
17
+Takes ranges of commits and replays them onto a new location. Leaves
18
the working tree and the index untouched, and updates no references.
19
The output of this command is meant to be used as input to
21
-`git update-ref --stdin`, which would update the relevant branches.
20
+`git update-ref --stdin`, which would update the relevant branches
21
+(see the OUTPUT section below).
22
23
THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.
24
28
--onto <newbase>::
29
Starting point at which to create the new commits. May be any
30
valid commit, and not just an existing branch name.
31
++
32
+The update-ref command(s) in the output will update the branch(es) in
33
+the revision range to point at the new commits, similar to the way how
34
+`git rebase --update-refs` updates multiple branches in the affected
35
+range.
36
+
37
+<revision-range>::
38
+ Range of commits to replay; see "Specifying Ranges" in
39
+ linkgit:git-rev-parse and the "Commit Limiting" options below.
40
+
41
+include::rev-list-options.txt[]
42
+
43
+OUTPUT
44
+------
45
+
46
+When there are no conflicts, the output of this command is usable as
47
+input to `git update-ref --stdin`. It is of the form:
48
+
49
+ update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
50
+ update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
51
+ update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}
52
+
53
+where the number of refs updated depends on the arguments passed and
54
+the shape of the history being replayed.
55
56
EXIT STATUS
57
-----------
61
able to complete (or start) due to some kind of error, the exit status
62
is something other than 0 or 1.
63
64
+EXAMPLES
65
+--------
66
+
67
+To simply rebase `mybranch` onto `target`:
68
+
69
+------------
70
+$ git replay --onto target origin/main..mybranch
71
+update refs/heads/mybranch ${NEW_mybranch_HASH} ${OLD_mybranch_HASH}
72
+------------
73
+
74
+When calling `git replay`, one does not need to specify a range of
75
+commits to replay using the syntax `A..B`; any range expression will
76
+do:
77
+
78
+------------
79
+$ git replay --onto origin/main ^base branch1 branch2 branch3
80
+update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
81
+update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
82
+update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}
83
+------------
84
+
85
+This will simultaneously rebase `branch1`, `branch2`, and `branch3`,
86
+all commits they have since `base`, playing them on top of
87
+`origin/main`. These three branches may have commits on top of `base`
88
+that they have in common, but that does not need to be the case.
89
+
90
GIT
91
---
92
Part of the linkgit:git[1] suite