From: Jeff King <peff@peff.net>
To: "Stefan Näwe" <stefan.naewe@atlas-elektronik.com>
Cc: Garbageyard <varuag.chhabra@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Change default branch name (server side) while cloning a repository
Date: Fri, 27 Mar 2015 12:47:14 -0400 [thread overview]
Message-ID: <20150327164714.GA10191@peff.net> (raw)
In-Reply-To: <551568CF.2050301@atlas-elektronik.com>
On Fri, Mar 27, 2015 at 03:27:27PM +0100, Stefan Näwe wrote:
> > If i now clone the repository on my local machine, then the default branch
> > should be pointing to mainline and not master. However, the issue is that it
> > still points to master. Am I /wrong/ in assuming that changing the entry in
> > file HEAD for a given repository on Git server will change the default
> > branch while cloning? If I’m wrong, can anyone please tell me how can I
> > enforce this change on the /server/ side correctly?
>
> Works for me with "gitolite3 v3.6.2-24-g8e36230 on git 2.3.4".
It may be related to the version.
Prior to v1.8.4.3, git servers did not communicate the symbolic ref data
to the client. The client guessed it based on which branch had the same
sha1 as HEAD, and if there was ambiguity, it guessed "master" over
others. So it would usually work, but would sometimes have odd results.
In v1.8.4.3, the server started advertising the name of the branch. You
need the client and server both to be that version or more recent for it
to work (otherwise, git falls back to the guessing behavior).
-Peff
next prev parent reply other threads:[~2015-03-27 16:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-27 12:27 Change default branch name (server side) while cloning a repository Garbageyard
2015-03-27 14:27 ` Stefan Näwe
2015-03-27 16:47 ` Jeff King [this message]
2015-03-27 16:40 ` Matthieu Moy
-- strict thread matches above, loose matches on Subject: below --
2015-03-29 7:33 Gaurav Chhabra
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=20150327164714.GA10191@peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=stefan.naewe@atlas-elektronik.com \
--cc=varuag.chhabra@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.