mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: asymptosis <>
To: Bagas Sanjaya <>
Cc: "Björn Kautler" <>,
	"" <>
Subject: Re: Bug when cloning a repository with a default branch called HEAD
Date: Mon, 31 May 2021 04:37:20 +0000	[thread overview]
Message-ID: <YLRoAIBExd+dAe0C@sleipnir.acausal.realm> (raw)
In-Reply-To: <>

>I'm trying to create minimal reproducible test repo by switching 
>initial branch to HEAD:
>$ mkdir shark && cd shark
>$ git init
>$ git checkout -b HEAD
> /snip
>The remote [1] might misconfigured default branch, so instead of 
>master/main it pointed to HEAD, and it caused the issue.

Hi Bagas,

I think he meant the remote had its default branch set to HEAD before he tried cloning. I.e. reproducing the error would look something more like this:

#! /bin/bash
mkdir $remote_repo
cd $remote_repo
git init -b HEAD
touch README
git add -A && git commit -m "Initial commit"
cd ..
git clone $remote_repo $local_repo

For me, the generated /tmp/local repo does issue warnings about ambiguous HEAD ref. However, it still works, and I don't get the wild errors like reported by Björn.

I suspect it's something to do with the implementation on the local OS. I'm on Linux and it seems like Björn is using Windows.

  reply	other threads:[~2021-05-31  4:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 19:05 Bug when cloning a repository with a default branch called HEAD Björn Kautler
2021-05-31  4:01 ` Bagas Sanjaya
2021-05-31  4:37   ` asymptosis [this message]
     [not found]     ` <>
2021-05-31 20:38       ` Fwd: " Björn Kautler
2021-05-31 20:45         ` Randall S. Becker
     [not found]           ` <>
2021-05-31 20:57             ` Björn Kautler

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 \
    --in-reply-to=YLRoAIBExd+dAe0C@sleipnir.acausal.realm \ \ \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

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 read-only IMAP folder(s) and NNTP newsgroup(s).