aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-rebase.txt
diff options
context:
space:
mode:
authorDerrick Stolee <derrickstolee@github.com>2022-07-19 18:33:39 +0000
committerJunio C Hamano <gitster@pobox.com>2022-07-19 12:49:04 -0700
commit900b50c242dfa6b47033cbb495d2fd9d06752ff1 (patch)
treef1c4440f77ca55f9d476d17c8b8e126864ad5fa4 /Documentation/git-rebase.txt
parenta97d79163e16e2d3777ab4d86c8f006f260c2836 (diff)
downloadgit-900b50c242dfa6b47033cbb495d2fd9d06752ff1.tar.gz
rebase: add --update-refs option
When working on a large feature, it can be helpful to break that feature into multiple smaller parts that become reviewed in sequence. During development or during review, a change to one part of the feature could affect multiple of these parts. An interactive rebase can help adjust the multi-part "story" of the branch. However, if there are branches tracking the different parts of the feature, then rebasing the entire list of commits can create commits not reachable from those "sub branches". It can take a manual step to update those branches. Add a new --update-refs option to 'git rebase -i' that adds 'update-ref <ref>' steps to the todo file whenever a commit that is being rebased is decorated with that <ref>. At the very end, the rebase process updates all of the listed refs to the values stored during the rebase operation. Be sure to iterate after any squashing or fixups are placed. Update the branch only after those squashes and fixups are complete. This allows a --fixup commit at the tip of the feature to apply correctly to the sub branch, even if it is fixing up the most-recent commit in that part. This change update the documentation and builtin to accept the --update-refs option as well as updating the todo file with the 'update-ref' commands. Tests are added to ensure that these todo commands are added in the correct locations. This change does _not_ include the actual behavior of tracking the updated refs and writing the new ref values at the end of the rebase process. That is deferred to a later change. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-rebase.txt')
-rw-r--r--Documentation/git-rebase.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 262fb01aec..dfd847d661 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -609,6 +609,12 @@ provided. Otherwise an explicit `--no-reschedule-failed-exec` at the
start would be overridden by the presence of
`rebase.rescheduleFailedExec=true` configuration.
+--update-refs::
+--no-update-refs::
+ Automatically force-update any branches that point to commits that
+ are being rebased. Any branches that are checked out in a worktree
+ are not updated in this way.
+
INCOMPATIBLE OPTIONS
--------------------
@@ -632,6 +638,7 @@ are incompatible with the following options:
* --empty=
* --reapply-cherry-picks
* --edit-todo
+ * --update-refs
* --root when used in combination with --onto
In addition, the following pairs of options are incompatible: