Function: magit-remote-set-head

magit-remote-set-head is an interactive and natively 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

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