0

I have a Git branch that should have been deleted, but it is still visible for most git commands (e.g. git show phantom).

git show-ref phantom doesn't find the reference

git log --decorate --max-count=1 phantom finds the reference, but doesn't show any branches or tags on the commit.

git fsck list a bunch of dangling objects, but nothing else.

Dan Berindei
  • 7,054
  • 3
  • 41
  • 48
  • possible duplicate of [How to fix stale git branch -r (delete phantom git branches)?](http://stackoverflow.com/questions/16786786/how-to-fix-stale-git-branch-r-delete-phantom-git-branches) – Joe May 28 '14 at 12:10
  • @Joe that question was about remote-tracking branches, my branch is (was) local. – Dan Berindei May 28 '14 at 12:34

1 Answers1

0

I managed to delete the reference with

git update-ref -d phantom

I was stumped by the fact that it didn't show up either as a branch or as a tag, but I guess git-update-ref doesn't care about such trifles.

Dan Berindei
  • 7,054
  • 3
  • 41
  • 48