Home Explore Blog CI



git

1st chunk of `Documentation/git-replay.adoc`
dc560c177f1b9bd90806fe13c4c2ccbf24ba4bbf56b89c0e000000010000089a
git-replay(1)
=============

NAME
----
git-replay - EXPERIMENTAL: Replay commits on a new base, works with bare repos too


SYNOPSIS
--------
[verse]
(EXPERIMENTAL!) 'git replay' ([--contained] --onto <newbase> | --advance <branch>) <revision-range>...

DESCRIPTION
-----------

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
`git update-ref --stdin`, which would update the relevant branches
(see the OUTPUT section below).

THIS COMMAND IS EXPERIMENTAL. THE BEHAVIOR MAY CHANGE.

OPTIONS
-------

--onto <newbase>::
	Starting point at which to create the new commits.  May be any
	valid commit, and not just an existing branch name.
+
When `--onto` 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 `git rebase --update-refs` updates
multiple branches in the affected range.

--advance <branch>::
	Starting point at which to create the new commits; must be a
	branch name.
+
When `--advance` is specified, the update-ref command(s) in the output
will update the branch passed as an argument to `--advance` to point at
the new commits (in other words, this mimics a cherry-pick operation).

<revision-range>::
	Range of commits to replay. More than one <revision-range> can
	be passed, but in `--advance <branch>` mode, they should have
	a single tip, so that it's clear where <branch> should point
	to. See "Specifying Ranges" in linkgit:git-rev-parse[1] and the
	"Commit Limiting" options below.

include::rev-list-options.adoc[]

OUTPUT
------

When there are no conflicts, the output of this command is usable as
input to `git update-ref --stdin`.  It is of the form:

	update refs/heads/branch1 ${NEW_branch1_HASH} ${OLD_branch1_HASH}
	update refs/heads/branch2 ${NEW_branch2_HASH} ${OLD_branch2_HASH}
	update refs/heads/branch3 ${NEW_branch3_HASH} ${OLD_branch3_HASH}

where the number of refs updated depends on the arguments passed and
the shape of the history being replayed.  When using `--advance`, the
number of refs updated is always

Title: Git Replay Command
Summary
The git-replay command is an experimental Git tool that replays commits on a new base, leaving the working tree and index untouched, and updates no references. It takes ranges of commits and replays them onto a new location, providing options to specify the new base and revision range, and its output is meant to be used as input to update references, such as branches, using the git update-ref command.