Skip to content

Incorrect branch name when no commits exist on new repo #1428

@mbomb007

Description

@mbomb007
  • GitLens Version: 11.3.0
  • Git Version: 2.30.0
  • VSCode Version: 1.54.3
  • OS Version: Windows 10 version 2004, using WSL2

Steps to Reproduce:

  1. Set your default branch name to something other than "main"
  2. Create a new Git repo by running git init
  3. There are files to commit but no commits
  4. In the Source Control bar, the box at the top to type a commit message correctly states your branch name, which matches the branch you are on, shown with git status. E.g. Message (Ctrl+Enter to commit on 'master')
  5. However, the COMMITS tab has an indicator that says the branch, and it says main to the right of the word "COMMITS", regardless of your Git init.defaultbranch setting. I have the setting set to something different from main in both WSL and Windows. The name will only be shown incorrectly until a repo is cloned, then it becomes correct.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions