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

git branch behavior after git init needs fixing

From
RJRyan Johnson <ryan.johnson.code@gmail.com>
Date
Feb 9, 2026, 09:43 UTC
Message-ID
<DS0PR03MB72900848B03D2B87A6846DCAA365A@DS0PR03MB7290.namprd03.prod.outlook.com>
Immediately after running `git init`, Git's `git branch` output is empty.
This is problematic because this implies that there is no default branch. I am told that there is a subtle distinction between an already-created branch and a "promise" to create a branch upon git init. The "promise" of a branch is not exposed, when it should be in the `git branch`command.
Hiding the default branch name from git branch is inconsistent with the information reported by other commands like `git status` and clashes with the availability of branch operations. `git status` reports that the repository is "On branch master". A typical user will need to rename their branch from master to main to conform with modern standards, so having no branch shown is confusing and quite frankly wrong. In the interest of fixing stupid UX design, make `git branch`produce the expected output, regardless of the literal internal workings of git.
Next: Ben Knoble
Message 1 of 4 in “git branch behavior after git init needs fixing”
  1. Ryan JohnsonFeb 9, 2026
  2. Ben KnobleFeb 9, 2026
  3. Junio C HamanoFeb 9, 2026
  4. Junio C HamanoFeb 9, 2026

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.