Function: magit-merge-dissolve

magit-merge-dissolve is an autoloaded, interactive and byte-compiled function defined in magit-merge.el.

Signature

(magit-merge-dissolve BRANCH &optional ARGS)

Documentation

Merge the current branch into BRANCH and remove the former.

Before merging, force push the source branch to its push-remote, provided the respective remote branch already exists, ensuring that the respective pull-request (if any) won't get stuck on some obsolete version of the commits that are being merged. Finally if forge-branch-pullreq was used to create the merged branch, then also remove the respective remote branch.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-merge.el
;;;###autoload
(defun magit-merge-dissolve (branch &optional args)
  "Merge the current branch into BRANCH and remove the former.

Before merging, force push the source branch to its push-remote,
provided the respective remote branch already exists, ensuring
that the respective pull-request (if any) won't get stuck on some
obsolete version of the commits that are being merged.  Finally
if `forge-branch-pullreq' was used to create the merged branch,
then also remove the respective remote branch."
  (interactive
    (list (let ((branch (magit-get-current-branch)))
            (magit-read-other-local-branch
             (format "Merge `%s' into" (or branch (magit-rev-parse "HEAD")))
             nil
             (and branch (magit-get-local-upstream-branch branch))))
          (magit-merge-arguments)))
  (let ((current (magit-get-current-branch))
        (head (magit-rev-parse "HEAD")))
    (when (zerop (magit-call-git "checkout" branch))
      (if current
          (magit--merge-absorb current args)
        (magit-run-git-with-editor "merge" args head)))))