Function: magit-pull-into-upstream

magit-pull-into-upstream is an autoloaded, interactive and byte-compiled function defined in magit-pull.el.

Signature

(magit-pull-into-upstream)

Documentation

Update the upstream of the current branch from its own upstream.

If the upstream of the current branch is a local branch, and the upstream of that is a remote branch, then update the local upstream. This makes it possible to update the upstream branch, without having to first check it out.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260822.1158/magit-pull.el
;;;###autoload(autoload 'magit-pull-into-upstream "magit-pull" nil t)
(transient-define-suffix magit-pull-into-upstream ()
  "Update the upstream of the current branch from its own upstream.

If the upstream of the current branch is a local branch, and the
upstream of that is a remote branch, then update the local upstream.
This makes it possible to update the upstream branch, without having
to first check it out."
  :if #'magit-pull--upstreams
  :description (##cdr (magit-pull--upstreams))
  (interactive)
  (if-let ((upstreams (magit-pull--upstreams)))
      (pcase-let* ((`(,up1 . ,up2) upstreams)
                   (`(,remote . ,branch) (magit-split-branch-name up2)))
        (magit-run-git-async "fetch" remote branch)
        (set-process-sentinel
         magit-this-process
         (lambda (process _event)
           (when (memq (process-status process) '(exit signal))
             (magit-run-git-async "update-ref" (concat "refs/heads/" up1)
                                  "FETCH_HEAD")))))
    (user-error "Cannot perform background update of upstream branch")))