From: Sheik Date: Mon, 30 Oct 2023 15:33:45 GMT Subject: Re: Repository cloned using SSH does not respect bare repository initial branch Message-ID: <325c742b-c909-4f43-a120-6db8b402e5f5@gmail.com> In-Reply-To: <20231030093605.GE84866@coredump.intra.peff.net> On 30/10/23 20:36, Jeff King wrote: > On Thu, Oct 26, 2023 at 07:36:36AM +1100, Sheik wrote: > >> Repository cloned using SSH does not use the branch configured in the bare >> repository however repository cloned using filesystem does as expected. >> Shouldn't they both behave the same? > What version of Git is running on the ssh server? > > Your example seems to show that the parent repository has an unborn > branch (i.e., HEAD points to "refs/heads/test", but there are no commits > yet). I think the server-side bits you need for that to work showed up > in 59e1205d16 (ls-refs: report unborn targets of symrefs, 2021-02-05), > which is in v2.31. > > So even though your client seems to be v2.42 (from the output you gave), > if the server is older it may not be sending sufficient information. > There were also some other fixes on top of that, but I _think_ they were > all client-side (so your v2.42 clone command should be doing the right > thing). > > -Peff Confirming your observation above, yes this is a purely new bare repository which has no commits yet before cloning. Thanks Sheik