Function: magit-push-current-to-pushremote

magit-push-current-to-pushremote is an autoloaded, interactive and byte-compiled function defined in magit-push.el.

Signature

(magit-push-current-to-pushremote ARG1)

Documentation

Push the current branch to its push-remote.

When the push-remote is not configured, then read the push-remote from the user, set it, and then push to it. With a prefix argument the push-remote can be changed before pushed to it.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-push.el
;;;###autoload(autoload 'magit-push-current-to-pushremote "magit-push" nil t)
(transient-define-suffix magit-push-current-to-pushremote (args)
  "Push the current branch to its push-remote.

When the push-remote is not configured, then read the push-remote
from the user, set it, and then push to it.  With a prefix
argument the push-remote can be changed before pushed to it."
  :if #'magit-get-current-branch
  :description #'magit-push--pushbranch-description
  (interactive (list (magit-push-arguments)))
  (pcase-let ((`(,branch ,remote ,changed)
               (magit--select-push-remote "push there")))
    (when changed
      (magit-confirm 'set-and-push
        (list "Really use \"%s\" as push-remote and push \"%s\" there"
              remote branch)))
    (run-hooks 'magit-credential-hook)
    (magit-run-git-async "push" "-v" args remote
                         (format "refs/heads/%s:refs/heads/%s"
                                 branch branch)))) ; see #3847 and #3872