Function: magit-push-other

magit-push-other is an interactive and natively compiled function defined in magit-push.el.

Signature

(magit-push-other SOURCE TARGET ARGS)

Documentation

Push an arbitrary branch or commit somewhere.

Both the source and the target are read in the minibuffer.

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-push.el
;;;###autoload
(defun magit-push-other (source target args)
  "Push an arbitrary branch or commit somewhere.
Both the source and the target are read in the minibuffer."
  (interactive
    (let ((source (magit-read-local-branch-or-commit "Push")))
      (list source
            (magit-read-remote-branch
             (format "Push %s to" source) nil
             (cond ((magit-local-branch-p source)
                    (or (magit-get-push-branch source)
                        (magit-get-upstream-branch source)))
                   ((magit-rev-ancestor-p source "HEAD")
                    (or (magit-get-push-branch)
                        (magit-get-upstream-branch))))
             source 'confirm)
            (magit-push-arguments))))
  (magit-git-push source target args))