Function: magit-remote-set-head

magit-remote-set-head is an autoloaded, interactive and byte-compiled function defined in magit-remote.el.

Signature

(magit-remote-set-head REMOTE &optional BRANCH)

Documentation

Set the local representation of REMOTE's default branch.

Query REMOTE and set the symbolic-ref refs/remotes/<remote>/HEAD accordingly. With a prefix argument query for the branch to be used, which allows you to select an incorrect value if you fancy doing that.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-remote.el
;;;###autoload
(defun magit-remote-set-head (remote &optional branch)
  "Set the local representation of REMOTE's default branch.
Query REMOTE and set the symbolic-ref refs/remotes/<remote>/HEAD
accordingly.  With a prefix argument query for the branch to be
used, which allows you to select an incorrect value if you fancy
doing that."
  (interactive
    (let  ((remote (magit-read-remote "Set HEAD for remote")))
      (list remote
            (and current-prefix-arg
                 (magit-read-remote-branch (format "Set %s/HEAD to" remote)
                                           remote nil nil t)))))
  (magit-run-git "remote" "set-head" remote (or branch "--auto")))