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:

Clojure has lesser typing error problems than the others well-known dynamic typing languages

Give these snippets a try. // JS function foo () {   bar(1) } # Ruby def foo   bar(1) end ; Clojure (defn foo []    (bar 1)) As yo...