aboutsummaryrefslogtreecommitdiff
path: root/Documentation/git-replay.adoc
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2026-04-01 22:55:12 +0200
committerJunio C Hamano <gitster@pobox.com>2026-04-01 21:34:25 -0700
commit23d83f8ddbef9adcb87671358b473e55cf90c90b (patch)
tree8e290170f9de89e1002f6c8f80cffbdd84934ba8 /Documentation/git-replay.adoc
parent6542cacbb33490ab83ef87a5fbee694cd2863bdd (diff)
downloadgit-23d83f8ddbef9adcb87671358b473e55cf90c90b.tar.xz
replay: allow to specify a ref with option --ref
When option '--onto' is passed to git-replay(1), the command will update refs from the <revision-range> passed to the command. When using option '--advance' or '--revert', the argument of that option is a ref that will be updated. To enable users to specify which ref to update, add option '--ref'. When using option '--ref', the refs described above are left untouched and instead the argument of this option is updated instead. Because this introduces code paths in replay.c that jump to `out` before init_basic_merge_options() is called on `merge_opt`, zero-initialize the struct. Signed-off-by: Toon Claes <toon@iotcl.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-replay.adoc')
-rw-r--r--Documentation/git-replay.adoc22
1 files changed, 21 insertions, 1 deletions
diff --git a/Documentation/git-replay.adoc b/Documentation/git-replay.adoc
index 5bb478c281..a32f72aead 100644
--- a/Documentation/git-replay.adoc
+++ b/Documentation/git-replay.adoc
@@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
(EXPERIMENTAL!) 'git replay' ([--contained] --onto=<newbase> | --advance=<branch> | --revert=<branch>)
- [--ref-action=<mode>] <revision-range>
+ [--ref=<ref>] [--ref-action=<mode>] <revision-range>
DESCRIPTION
-----------
@@ -66,6 +66,16 @@ incompatible with `--contained` (which is a modifier for `--onto` only).
Update all branches that point at commits in
<revision-range>. Requires `--onto`.
+--ref=<ref>::
+ Override which reference is updated with the result of the replay.
+ The ref must be fully qualified.
+ When used with `--onto`, the `<revision-range>` should have a
+ single tip and only the specified reference is updated instead of
+ inferring refs from the revision range.
+ When used with `--advance` or `--revert`, the specified reference is
+ updated instead of the branch given to those options.
+ This option is incompatible with `--contained`.
+
--ref-action[=<mode>]::
Control how references are updated. The mode can be:
+
@@ -189,6 +199,16 @@ NOTE: For reverting an entire merge request as a single commit (rather than
commit-by-commit), consider using `git merge-tree --merge-base $TIP HEAD $BASE`
which can avoid unnecessary merge conflicts.
+To replay onto a specific commit while updating a different reference:
+
+------------
+$ git replay --onto=112233 --ref=refs/heads/mybranch aabbcc..ddeeff
+------------
+
+This replays the range `aabbcc..ddeeff` onto commit `112233` and updates
+`refs/heads/mybranch` to point at the result. This can be useful when you want
+to use bare commit IDs instead of branch names.
+
GIT
---
Part of the linkgit:git[1] suite