Wednesday, March 30, 2011

How to delete a remote git tag

I suppose this is probably taboo. You're not supposed to mess with tags once you've pushed them upstream. Still, there are times when it is necessary, and unfortunately `git push --tags` does not push the local removal of tags upstream. It always takes me forever to figure this out, so I figured I'd write it down. Maybe someone else will find it useful.

git tag -d tag-to-delete
git push origin :refs/tags/tag-to-delete

This will remove that tag from the remote repository. You can verify this by pulling from the remote again and seeing that it does not get pulled back down.

1 comment:

Kavi said...

I have tried the same .. but i am getting bellow error while pushing the deleted tag to remote

Error: "DENIED by fallthru"

remote: + refs/tags/***-1.0 XYZ/XYZ Kavi DENIED by fallthru