Bug in `git branch --delete main` when on other orphan branch
- From
Martin von Zweigbergk <martinvonz@google.com>
- Date
- Oct 29, 2022, 05:46 UTC
- Message-ID
- <CAESOdVBpsbJ0obD=qDjHBJg-wwWUL5sQ-7X_h13Vw39Q9QUzHA@mail.gmail.com>
Hi,
I did this: git init test cd test echo a > file git add file git commit -m a git checkout --orphan other git branch --delete main
The last command fails with: fatal: Couldn't look up commit object for HEAD
That's a bug, right? I can of course work around it with `rm .git/refs/heads/main`.