Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthias Goergens <matthias.goergens@gmail.com>
Cc: git@vger.kernel.org, "Niklas Cassel" <cassel@kernel.org>,
	"Bence Ferdinandy" <bence@ferdinandy.com>,
	"Philip Oakley" <philipoakley@iee.org>,
	"Jean-Noël Avila" <jn.avila@free.fr>
Subject: Re: [PATCH] doc: clarify that set-head does not change the remote's HEAD
Date: Mon, 28 Sep 2026 12:01:49 -0700	[thread overview]
Message-ID: <xmqq4if9mc82.fsf@gitster.g> (raw)
In-Reply-To: <20260927055040.2441925-1-matthias.goergens@gmail.com> (Matthias Goergens's message of "Sun, 27 Sep 2026 13:50:40 +0800")

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.

>  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

  reply	other threads:[~2026-09-28 19:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-27  5:50 [PATCH] doc: clarify that set-head does not change the remote's HEAD Matthias Goergens
2026-09-28 19:01 ` Junio C Hamano [this message]
2026-09-29 12:00 ` [PATCH v2] doc: remote: say that it only affects the local repository Matthias Goergens
2026-09-29 16:28   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq4if9mc82.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=bence@ferdinandy.com \
    --cc=cassel@kernel.org \
    --cc=git@vger.kernel.org \
    --cc=jn.avila@free.fr \
    --cc=matthias.goergens@gmail.com \
    --cc=philipoakley@iee.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox