git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] doc: clarify that set-head does not change the remote's HEAD

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 28, 2026, 19:01 UTC
Message-ID
<xmqq4if9mc82.fsf@gitster.g>
In-Reply-To
<20260927055040.2441925-1-matthias.goergens@gmail.com>
Matthias Goergens <matthias.goergens@gmail.com> writes:
> `git remote set-head <name> <branch>` 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.

This is true, but the local nature of the command is not limited to set-head.

Adding a new 5 line paragraph specifically to the description of the `set-head` command may be an improvement, but I wonder if we should tell the readers that anything and everything done via "git remote" affects the local repository, not the remote one, as the very first thing in the manual page. That way, we do not have to say that 'remote prune' only prunes remote-tracking branches and does not run any pruning command on the remote repository, for example.

Thanks.
Show 20 quoted lines
>  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/<name>/HEAD` is deleted.
>  +
>  With `-a` or `--auto`, the remote is queried to determine its `HEAD`, then the
Previous: Matthias GoergensNext: Matthias Goergens
Message 2 of 4 in “doc: clarify that set-head does not change the remote's HEAD”
  1. doc: clarify that set-head does not change the remote's HEADMatthias Goergens, Sep 27, 2026
  2. Junio C HamanoSep 28, 2026
  3. doc: remote: say that it only affects the local repositoryMatthias Goergens, Sep 29, 2026
  4. Junio C HamanoSep 29, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.