Cannot Create a New Branch in an Empty Repository
What steps will reproduce the problem?
- Clone an empty repository with no branches (https://github.com/billdenney/empty.git is the example I'm using)
- Right click in the repository directory and choose TortoiseGit>Create Branch
- In the name for the new branch enter any valid branch name ("foo" is what I used)
- Click "OK" to create the branch
What is the expected output? What do you see instead?
Expected output: A new branch is created
Observed output: a fatal error: "fatal: Not a valid object name: 'HEAD'."
What version of TortoiseGit and Git are you using? On what operating system?
TortoiseGit: 2.9.0.0
git: 2.22.0.windows.1
Please provide any additional information below.
Looking at StackOverflow (https://stackoverflow.com/questions/5678699/creating-branches-on-an-empty-project-in-git), I think the correct solution is that there must be an initial commit as the basis. My preferred way for TortoiseGit to handle this would be to warn the user that an initial commit is required before you can create a branch, and then offer to do an initial, empty commit.