git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: how to start with non-master branch?

From
DSDirk Süsserott <newsletter@dirk.my1.cc>
Date
Jul 19, 2009, 16:13 UTC
Message-ID
<4A634616.9020302@dirk.my1.cc>
In-Reply-To
<f46c52560907190553x4e21ffbdn6d55c43f2d6b08ad@mail.gmail.com>
Am 19.07.2009 14:53 schrieb Rustom Mody:
Show 16 quoted lines
> I want my first commit to be on a non-master branch.
> So after the git init I do
> $ git checkout -b newbranch
> 
> I get
> fatal: You are on a branch yet to be born
> 
> Of course I can get by with making the first commit on master and then
> switching.
> 
> But wondering if I am missing something basic?
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

What about renaming the "initial master", i.e.: git init git add . git commit -m "intial checkin" git branch -m non-master-branch

and later adding a master just as any other branch, i.e. git checkout -b master

Unfortunately renaming doesn't work before the first commit, I got an error similar to yours.

I think the name "master" is just a convention and there's nothing special about that branch. Could've been called "main" or sth. as well when Linus invented it.

Dirk
Previous: Rustom ModyNext: Sean Estabrooks
Message 2 of 5 in “how to start with non-master branch?”
  1. Rustom ModyJul 19, 2009
  2. Dirk SüsserottJul 19, 2009
  3. Sean EstabrooksJul 19, 2009
  4. Charles BaileyJul 19, 2009
  5. Michael J GruberJul 19, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.