From: Jeff King Date: Sat, 27 Jun 2020 03:11:11 GMT Subject: Re: Regarding Git and Branch Naming Message-ID: <20200627031111.GB1187031@coredump.intra.peff.net> In-Reply-To: <6b9d76e4-68dd-8e57-f96a-318579dea6f3@iee.email> On Fri, Jun 26, 2020 at 10:33:14PM +0100, Philip Oakley wrote: > A wild bikeshed question: Is HEAD itself protected as a branch name e.g. > that HEAD could contain `ref: HEAD` or `ref: refs/heads/HEAD`? (or maybe > the nullĀ  oid The first is not legal; we insist that symrefs start with "refs/". The second one _is_ legal, but isn't any kind of loop. The HEAD symref is .git/HEAD, which is distinct from a ref of the same name inside refs/heads/. It's confusing, of course, because the lookup rules make it hard to refer to refs/heads/HEAD. For that reason we do disallow it from the branch-creation porcelains like git-branch and git-checkout. -Peff