From: Junio C Hamano <gitster@pobox.com>
To: "Daniel Martí" <mvdan@mvdan.cc>
Cc: git@vger.kernel.org
Subject: Re: mirror clone does not keep HEAD updated
Date: Tue, 04 Apr 2023 09:38:07 -0700 [thread overview]
Message-ID: <xmqqileb1u34.fsf@gitster.g> (raw)
In-Reply-To: <harpgnimhcdp2m6hww7ht7pgxvchllvrncnwoxkivaorb5xhm7@5rcr2p7hcp4x> ("Daniel Martí"'s message of "Tue, 4 Apr 2023 17:16:57 +0100")
Daniel Martí <mvdan@mvdan.cc> writes:
> I'm testing `git clone --mirror` to properly mirror a repository on
> github.com. It appears to be working well, except for keeping HEAD
> correctly in place.
There is no such feature in "git clone" or "git fetch" to check what
branch the remote HEAD is pointing at and move the local copy around.
For a long time, even "git clone" did not have a reliable way to see
where the HEAD at the remote site points at, and it used heuristics
to guess what name to give to the first branch on the local side.
Modern versions of Git these days have a protocol level support to
convey that information, and I think it is feasible to invent such a
feature to automatically repoint refs/remotes/$remote/HEAD to
whatever remote-tracking branch found in the refs/remotes/$remote/
hierarchy.
I do not think anybody is working on such a project, though.
We are pretty much "somebody should initiate the process to scratch
their own itch, and we will help them in doing so" community, so you
or somebody who reads this thread interesting will hopefully start
such an effort ;-)
Thanks.
next prev parent reply other threads:[~2023-04-04 16:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 16:16 mirror clone does not keep HEAD updated Daniel Martí
2023-04-04 16:38 ` Junio C Hamano [this message]
2023-04-05 1:56 ` Felipe Contreras
2023-04-05 1:38 ` Felipe Contreras
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=xmqqileb1u34.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=mvdan@mvdan.cc \
/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;
as well as URLs for NNTP newsgroup(s).