How to delete the git reference `refs/original/refs/heads/master`?

What's this in the yellow round box?

screenshot

I've tried git branch -D, git tag -d but none succeeded. So how to delete it?


Alexey Ten has the better answer for this because it handles branches, tags, and packed refs. Future visitors should try that solution before this one.


If it's a tag, the following command ought to work:

git tag -d refs/original/refs/heads/master

But, since you've said it doesn't, you can just delete the file out of the .git directory. From the repository root, a command like this will get it:

rm .git/refs/tags/refs/original/refs/heads/master

The path may be slightly different if the git-tag command failed, so you may want to cd .git/refs and find the offending head by trial-and-error. Deleting the file will remove the reference from your local repository.


This command should work

git update-ref -d refs/original/refs/heads/master

This is a ref. Normally created by git filter-branch - it is a pointer to where your branch was before you ran git filter-branch.

And to delete any ref, you can always push nothing to it in the local repository:

git push . :refs/original/refs/heads/master

The other answers also covered pretty well other ways of deleting.