Function: magit-rebase-subset

magit-rebase-subset is an interactive and natively compiled function defined in magit-sequence.el.

Signature

(magit-rebase-subset NEWBASE START ARGS)

Documentation

Rebase a subset of the current branch's history onto a new base.

Rebase commits from START to HEAD onto NEWBASE. START has to be selected from a list of recent commits.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/irvbdy0zra0dn8fpd008f32x5ix6qm5v-emacs-packages-deps/share/emacs/site-lisp/elpa/magit-20261005.508/magit-sequence.el
;;;###autoload
(defun magit-rebase-subset (newbase start args)
  "Rebase a subset of the current branch's history onto a new base.
Rebase commits from START to `HEAD' onto NEWBASE.
START has to be selected from a list of recent commits."
  (interactive (list (magit-read-other-branch-or-commit
                      "Rebase subset onto" nil
                      (magit-get-upstream-branch))
                     nil
                     (magit-rebase-arguments)))
  (cond (start
         (message "Rebasing...")
         (magit-run-git-sequencer "rebase" "--onto" newbase start args)
         (message "Rebasing...done"))
        ((magit-log-select
           `(lambda (commit)
              (magit-rebase-subset ,newbase (concat commit "^") (list ,@args)))
           (concat "Type %p on a commit to rebase it "
                   "and commits above it onto " newbase ",")))))