Home > database >  new branch isn't showing up with git branch -a
new branch isn't showing up with git branch -a

Time:07-04

I create a new branch with git checkout -b "branch_name" I would expect to see this branch when I run git branch -a: But I see no results, any ideas what could be causing this?

git version 2.36.1.windows.1

enter image description here

CodePudding user response:

This might happen if you have no commits in the branch.

CodePudding user response:

This is a completely empty repository; that is, it contains no commits. Therefore you are in the curious position of working with what is usually called an unborn branch. You are allowed to create the branch name so as to dictate what branch you will be on when you do create a commit. But until then, the branch is unborn and is not listed in your git branch output.

  •  Tags:  
  • git
  • Related