Remove a Git Tag From Github When There is Also a Branch of the Same Name
I have been using git and Github off and on for a while now but I’ve never really learned much about it.
Today, I mistakenly added a tag with the same name as a branch and pushed it to Github. I was able to get rid of it locally but I was pulling my hair out trying to figure out to remove it from Github. I finally stumbled on the solution so here is what I learned.
Removing a git tag:
git tag -d <tag>
Removing a git branch:
git branch -d <branch>
Deleting a tag or branch from Github:
git push origin :<tag or branch>
Deleting a tag (with the same name as a branch) from Github:
git push origin :refs/tags/<tag>
Deleting a branch (with the same name as a tag) from Github:
git push origin :refs/heads/<branch>