Wednesday, February 23, 2011

[Git] delete/remove remote tag

To delete/remove remote branch in Git, you use
git push <remote*> :<branch-to-remove>

Also to delete/remove tag in remote server, you can use
git push <remote> :refs/tags/<tag-to-remote>

These commands might seem weird and hard to remember. To be able to remember them easier, I suggest you to see this full git push command
git push <remote> <local-branch-name>:<remote-branch-name>

Then to delete is to push empty branch to expected branch on remote. That's all why.

 *remote is an alias of other repository see git remote
Credit: How to: Delete a remote Git tag


The current version of git now support argument --delete for push. So now you can delete branch hello from origin with this command
git push --delete origin hello

No comments:

[PostgreSQL] How to create read-only standby replica (follower)

This link  and this link explain it really well and concise