Function: magit-pull-into-upstream

magit-pull-into-upstream is an interactive and natively 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

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-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")))