Function: magit-pull-from-upstream
magit-pull-from-upstream is an autoloaded, interactive and
byte-compiled function defined in magit-pull.el.
Signature
(magit-pull-from-upstream ARG1)
Documentation
Pull from the upstream of the current branch.
With a prefix argument or when the upstream is either not configured or unusable, then let the user first configure the upstream.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-pull.el
;;;###autoload(autoload 'magit-pull-from-upstream "magit-pull" nil t)
(transient-define-suffix magit-pull-from-upstream (args)
"Pull from the upstream of the current branch.
With a prefix argument or when the upstream is either not
configured or unusable, then let the user first configure
the upstream."
:if #'magit-get-current-branch
:description #'magit-pull--upstream-description
(interactive (list (magit-pull-arguments)))
(let* ((branch (or (magit-get-current-branch)
(user-error "No branch is checked out")))
(remote (magit-get "branch" branch "remote"))
(merge (magit-get "branch" branch "merge")))
(when (or current-prefix-arg
(not (or (magit-get-upstream-branch branch)
(magit--unnamed-upstream-p remote merge))))
(magit-set-upstream-branch
branch (magit-read-upstream-branch
branch (format "Set upstream of %s and pull from there" branch)))
(setq remote (magit-get "branch" branch "remote"))
(setq merge (magit-get "branch" branch "merge")))
(run-hooks 'magit-credential-hook)
(magit-run-git-with-editor "pull" args remote merge)))