From 215ca6d93d70e8d51db7c615d0106feb78f828ac Mon Sep 17 00:00:00 2001 From: Matthias Goergens Date: Sun, 27 Sep 2026 13:50:40 +0800 Subject: [PATCH] doc: clarify that set-head does not change the remote's HEAD `git remote set-head ` never changes the remote repository's own `HEAD`, i.e. the branch that a fresh `git clone` of that remote checks out; every change it makes is local. The current wording, "Set or delete the default branch ... for the named remote", reads as though the command changes the remote itself. It was recently misread that way in a discussion on another project's mailing list, until a test showed the remote's `HEAD` unchanged. Say that the change is local and that Git offers no client-side way to change a remote's own default branch. Signed-off-by: Matthias Goergens Signed-off-by: Junio C Hamano --- Documentation/git-remote.adoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/git-remote.adoc b/Documentation/git-remote.adoc index eaae30aa88..c9cf17e7bd 100644 --- a/Documentation/git-remote.adoc +++ b/Documentation/git-remote.adoc @@ -107,6 +107,12 @@ branch. For example, if the default branch for `origin` is set to `master`, then `origin` may be specified wherever you would normally specify `origin/master`. + +This command does not change the remote repository's own `HEAD`, i.e. +the branch that a fresh `git clone` of that remote will check out; +every change it makes is local. Git provides no way to change a +remote's own default branch from the client; how that is done depends +on how the remote is hosted. ++ With `-d` or `--delete`, the symbolic ref `refs/remotes//HEAD` is deleted. + With `-a` or `--auto`, the remote is queried to determine its `HEAD`, then the