Please excuse me if this is possible and i'm missing something. What i'm trying to do is:
git tag -d tag-to-delete
git push origin :refs/tags/tag-to-delete
Deleting the local tag works fine, it's the second command which I cannot find a solution for. I believe doing a Push-Tags should do the push origin to delete the remote tag (correct?)
My questions are:
Thanks!
How can I push a deleted local tag to also delete on the remote using Magit.
This is not currently possible.
how should this be implemented in Magit.
We currently do for branches what you suggest we do for tags. But (a) I am not sure yet, whether we should be doing that for branches in the first place and (b) tags are different: there are no "remote-tracking-tags" like for branches, so it is unclear on which remote the tag should be deleted.
To be honest I personally use the command line for pushing (except for the "push to the already configured remote/branch"). But I am going to look into the whole push&pull functionality soon, and will then also keep this in mind. There should be some way to delete a tag on some remote, but I cannot promise that deleting a tag locally and on (a) remote(s) will be combined into one command. Currently it looks like it is unlikely that I will do that.
But (a) I am not sure yet, whether we should be doing that for branches in the first place
I use magit for deleting branches in remotes a lot and would be very sad if that weren't possible anymore.
I am not sure yet, whether we should be doing that for branches in the first place
... but tend to think that, yes we should :-)
In #1484 I have added magit-tag-prune. It first reads a remote from the user, then it _offers_ to locally delete all tags which do not exist on that remote, and then to delete all tags on the remote which do not exist locally.
This probably sounds a bit strange at first but it is somewhat similar to pruning remote tracking branches using git remote prune REMOTE. But considering no such things as remote-tracking-tags exists it actually makes sense.
I have not added a command to delete a single tag locally and remotely. If we did that it would also make sense to add one to delete a tag remotely only, which would require that there is a way to display tags "as they exist remotely" which I don't want to add. Git handles branches and tags differently and here it shows. Considering all this I think a "cleanup all the tags" command as I have added, makes most sense.
Most helpful comment
In #1484 I have added
magit-tag-prune. It first reads a remote from the user, then it _offers_ to locally delete all tags which do not exist on that remote, and then to delete all tags on the remote which do not exist locally.This probably sounds a bit strange at first but it is somewhat similar to pruning remote tracking branches using
git remote prune REMOTE. But considering no such things as remote-tracking-tags exists it actually makes sense.I have not added a command to delete a single tag locally and remotely. If we did that it would also make sense to add one to delete a tag remotely only, which would require that there is a way to display tags "as they exist remotely" which I don't want to add. Git handles branches and tags differently and here it shows. Considering all this I think a "cleanup all the tags" command as I have added, makes most sense.