Delete a remote Git tag

Use a fully qualified tag ref, handle local copies separately, and preserve annotated-tag metadata when recovery matters.

Best practices
Illustration of Git branches and version history

Delete a tag on a remote with its full refname:

git push origin --delete refs/tags/v1.0
# Equivalent refspec form:
# git push origin :refs/tags/v1.0

The explicit refs/tags/ prefix avoids ambiguity if a branch has the same short name. These commands delete the server ref only. They do not delete your local tag, other people's copies, or release assets hosted separately.

Remove or inspect the local copy

git tag -d v1.0
git ls-remote --tags origin refs/tags/v1.0

Local deletion and remote deletion are independent. Before deleting a release tag, check who or what consumes it and retain the original ref or a backup if recovery may be necessary. Deleting a tag does not automatically delete its target commit.

Synchronize known deletions carefully

For a single shared deletion, collaborators can explicitly delete that local tag. They may otherwise retain it indefinitely and could push it back later.

Git can prune an entire tag namespace, but the scope is much wider:

git fetch --dry-run --prune --prune-tags origin

Review this preview before considering the real operation. Combined with pruning, --prune-tags can delete local tags absent from that remote, including tags created only locally or obtained from another remote. A normal fetch with branch pruning is not a universal tag-deletion synchronization mechanism.

Recover an accidentally deleted tag

If all you have is the commit ID, you can recreate a lightweight tag:

git tag v1.0 COMMIT_ID
git push origin refs/tags/v1.0

That does not recreate an annotated tag's original message, tagger, timestamp, or signature. An annotated tag points to a tag object; preserving only the peeled commit is insufficient to restore its identity. Retain the original tag object and a durable ref or external backup before deletion when those details matter.

FAQ

Does this remove a GitHub Release? A Git tag and a GitHub Release are separate objects. Do not assume deleting the ref removes assets, changes release visibility, or reverses a published release. Inspect the platform's release state and applicable immutable-release rules, then use its release-management workflow when needed.

Why is deletion refused? The server may enforce tag protection, repository rules, permissions, or immutability. Use the approved maintenance process or an authorized role; do not treat disabling protection as the automatic solution.

Should I delete all local tags and fetch again? Usually no. That destroys local-only tags and obscures the intended deletion. Prefer deleting the specific known tag unless you deliberately maintain a mirror of one remote's tag namespace.

See git-push, git-fetch, and GitHub release management.

Get a tailored plan

Contact us

Join the community

Scan with WeChat
to join the community

Try Guance

Start online and pay only for what you use.

Get started

Choose a Guance plan

Code hosting