Re: Regarding Git and Branch Naming
- From
Chris Torek <chris.torek@gmail.com>
- Date
- Jun 26, 2020, 18:33 UTC
- Message-ID
- <CAPx1GvcZk2o7f8-27xokwxUayWwO+t5qdsMjLrjBymc+WHznmw@mail.gmail.com>
- In-Reply-To
- <B4814F42-7AF8-4D80-93D4-FAF752C72F21@me.com>
On Fri, Jun 26, 2020 at 10:19 AM Craig H Maynard <chmaynard@me.com> wrote:
> Does the git init command really need to create a default branch? Perhaps that step could be left to the user.
The HEAD pseudo-ref must exist and must contain a valid OID or branch name. (If it does not exist, Git says that the directory is not a repository. Perhaps this test could be weakened, but that's definitely a fairly big change.)
In a new, empty repository there are no valid OIDs, so HEAD must contain a branch name. The branch itself need not exist, but whatever name is in HEAD is the branch that will be created when the user makes the first commit.
Chris