list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
From: Jeff King <>
To: Felipe Contreras <>
Cc: Junio C Hamano <>, Git <>,
	Jonathan Nieder <>,
	Dominik Salvet <>
Subject: Re: [RFC/PATCH] Add fetch.updateHead option
Date: Tue, 24 Nov 2020 01:58:46 -0500
Message-ID: <> (raw)
In-Reply-To: <>

On Fri, Nov 20, 2020 at 07:18:39PM -0600, Felipe Contreras wrote:

> On Fri, Nov 20, 2020 at 6:40 PM Jeff King <> wrote:
> > I don't think we do advertise the symref in such a case. In v2, the
> > symref information is attached to individual lines in the ref
> > advertisement. And we don't advertise the unborn line (we could, but I
> > think we might need a special syntax for the oid field).
> This may be worth considering changing.

I agree it might be nice, but may not be worth the effort (it will
require a protocol extension).


> If a hosting provider (e.g. GitHub) decides to configure an initial
> branch (e.g. main) it would be nice for "git clone" to have
> information about that initial branch so the user doesn't have to
> change it manually to please the provider's aesthetics.
> So the instructions could be:
>   git clone $url .
>   echo "# myproject" >>
>   git add
>   git commit -m "first commit"
>   # git branch -M main # this step would not be necessary
>   git push -u origin HEAD
> Personally I don't care about this. But others might find it useful.

I don't think you have to do the rename here if you don't want to.
If there is already content on the "main" branch at GitHub, then clone
should pick that as the default branch for your local clone.

If there isn't, then you'll get whatever your local git-clone decides
on. But when you push, at least to GitHub, if the server-side HEAD
points to an unborn branch, it will re-point to the newly pushed branch.
So with the current version of Git, you would end up with "master" on
the remote side. And that should continue to work as it always has
(AFAIK any changes on GitHub's side are purely about default branch
names, such as when you add template files as part of the repo

Of course if you _want_ "main" in both cases, you'd have to rename the
branch. But you would probably set init.defaultBranch in that case.


  reply	other threads:[~2020-11-24  7:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18  9:12 Felipe Contreras
2020-11-18  9:30 ` Ævar Arnfjörð Bjarmason
2020-11-18  9:43   ` Felipe Contreras
2020-11-18 15:53   ` Junio C Hamano
2020-11-18 19:04     ` Felipe Contreras
2020-11-20 23:52 ` Jeff King
2020-11-21  0:28   ` Junio C Hamano
2020-11-21  0:40     ` Jeff King
2020-11-21  1:18       ` Felipe Contreras
2020-11-24  6:58         ` Jeff King [this message]
2020-11-21  1:53     ` Felipe Contreras
2020-11-21  1:41   ` Felipe Contreras
2020-11-24  7:09     ` Jeff King

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:

  List information:

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

  git send-email \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ \
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for the project(s) associated with this inbox:

AGPL code for this site: git clone