How to fix error: tag 'v1.0.0' not found / remote rejected (pre-receive hook declined) in Git

GitBEGINNERLOWUpdated Dec 6, 2025ยท 106 views

Git tag deletion errors occur when the tag doesn't exist, when a branch has the same name, or when server-side protections prevent deletion. Solutions depend on whether you're deleting local or remote tags.

Quick fix

Fixes error: tag 'v1.0.0' not found / remote rejected (pre-receive hook declined)

# List local tags
git tag

# List remote tags
git ls-remote --tags origin

# Search for a specific pattern
git tag -l "v1.*"
  1. List existing tags to verify the tag exists
  2. Delete a local tag
  3. Delete a remote tag
  4. Handle 'refspec matches more than one' error
git โ€” error
# List local tags
git tag
# List remote tags
git ls-remote --tags origin
# Search for a specific pattern
git tag -l "v1.*"
error: tag 'v1.0.0' not found / remote rejected (pre-receive hook declined)

What this error means

Git tags are references to specific commits, commonly used to mark release versions (v1.0.0, v2.1.3). When you try to delete a tag, Git needs to locate it either locally or on a remote repository. Errors occur when Git cannot find the tag, when there's ambiguity with branch names, or when the remote server blocks the deletion. Deleting a local tag uses `git tag -d <tagname>`, while deleting a remote tag requires pushing the deletion with `git push --delete origin <tagname>` or the older refspec syntax `git push origin :refs/tags/<tagname>`. Each method can fail for different reasons. Common scenarios include: the tag only exists remotely (not locally), the tag is protected on GitLab/GitHub, the tag name matches a branch name causing ambiguity, or the tag was already deleted but your local view is stale. Understanding which type of tag you're dealing with is key to resolving the error.

Typical symptoms

  • git tag -d fails with 'error: tag not found'
  • git push --delete returns 'remote rejected' or 'pre-receive hook declined'
  • Error message says 'dst refspec matches more than one'
  • Tag appears in git ls-remote but deletion still fails
  • Warning 'Deleting a non-existent ref' when pushing tag deletion

Common causes

  1. The tag doesn't exist locally (only exists on remote, or was never fetched)
  2. Tag name is identical to a branch name, causing refspec ambiguity
  3. The tag is protected on GitLab/GitHub and cannot be deleted via git push
  4. You don't have permission to delete tags on the remote repository
  5. The tag name contains invisible characters or has different casing than expected
  6. Your push and fetch URLs point to different servers (split remote configuration)

How to fix "error: tag 'v1.0.0' not found / remote rejected (pre-receive hook declined)"

1List existing tags to verify the tag exists

Before deleting, confirm the tag exists and check its exact spelling:

bash
# List local tags
git tag

# List remote tags
git ls-remote --tags origin

# Search for a specific pattern
git tag -l "v1.*"

Tag names are case-sensitive. A tag named V1.0 is different from v1.0.

2Delete a local tag

To delete a tag from your local repository:

bash
git tag -d <tagname>

Example:

bash
git tag -d v1.0.0

If you get "tag not found", the tag may only exist on the remote. Fetch it first:

bash
git fetch --tags
git tag -d v1.0.0
3Delete a remote tag

To delete a tag from the remote repository:

bash
git push --delete origin <tagname>

Example:

bash
git push --delete origin v1.0.0

If this fails with an ambiguity error (tag name matches a branch), use the explicit refs syntax:

bash
git push origin :refs/tags/v1.0.0

This explicitly specifies you're deleting a tag, not a branch.

4Handle 'refspec matches more than one' error

When a tag and branch have the same name, Git cannot determine which one to delete:

bash
error: dst refspec v1.0.0 matches more than one

Solution: Use the full refs path to specify the tag explicitly:

bash
# Delete the tag (not the branch)
git push origin :refs/tags/v1.0.0

# Or delete both if needed
git push origin :refs/tags/v1.0.0 :refs/heads/v1.0.0
5Handle protected tag errors on GitLab/GitHub

If you see "pre-receive hook declined" or "You don't have permission", the tag may be protected.

For GitLab:
1. Go to Settings > Repository > Protected tags
2. Find and unprotect the tag, or
3. Delete via GitLab UI: Repository > Tags > Delete button (requires Maintainer role)

For GitHub:
1. Go to Settings > Branches (note: GitHub protects tags through branch rules for matching refs)
2. Check tag protection rules
3. Delete via GitHub UI: Releases > Delete the associated release and tag

Protected tags are intentional security features to prevent accidental deletion of release tags.

6Sync local tags with remote (prune deleted tags)

If tags were deleted on the remote but still appear locally, prune stale tags:

bash
# Fetch and prune tags not on remote
git fetch --prune --prune-tags

# Or configure automatic pruning
git config fetch.pruneTags true

To manually remove all local tags and re-fetch from remote:

bash
git tag -l | xargs git tag -d
git fetch --tags
7Delete multiple tags at once

To delete several tags in one command:

bash
# Delete multiple local tags
git tag -d tag1 tag2 tag3

# Delete multiple remote tags
git push --delete origin tag1 tag2 tag3

To delete all tags matching a pattern:

bash
# Delete all local v1.x tags
git tag -l "v1.*" | xargs git tag -d

# Delete all matching remote tags
git tag -l "v1.*" | xargs -I {} git push --delete origin {}
8Verify fetch and push URLs match

If git ls-remote shows the tag but deletion fails with "non-existent ref", your fetch and push URLs may differ:

bash
git remote -v

If they point to different servers, fix the configuration:

bash
# Set both URLs to the same location
git remote set-url origin https://github.com/user/repo.git
git remote set-url --push origin https://github.com/user/repo.git

Advanced notes

### Lightweight vs Annotated Tags

Git has two types of tags:
- Lightweight tags: Simple pointers to commits (like bookmarks)
- Annotated tags: Full objects with author, date, and message

Both are deleted the same way, but annotated tags are more common for releases. Check tag type with:

bash
git cat-file -t <tagname>
# Returns "commit" for lightweight, "tag" for annotated

### Recovering a Deleted Tag

If you accidentally delete a tag and know the commit it pointed to:

bash
# Find the commit SHA from reflog or logs
git reflog

# Recreate the tag
git tag v1.0.0 <commit-sha>
git push origin v1.0.0

### Git Bug in Version 2.11.0

There was a known bug in Git 2.11.0 (common on Ubuntu 14.04) where tag deletion would fail incorrectly. Upgrading Git resolves this issue:

bash
# Check Git version
git --version

# Upgrade on Ubuntu
sudo add-apt-repository ppa:git-core/ppa
sudo apt update && sudo apt install git

### CI/CD Considerations

In CI/CD pipelines, tag deletion may fail due to:
- Shallow clones (--depth 1) not fetching tags
- Limited permissions in the CI environment
- Protected tag rules blocking automated deletion

Ensure your CI runner has appropriate permissions and uses --tags when fetching.

Frequently asked questions

What does "error: tag 'v1.0.0' not found / remote rejected (pre-receive hook decl" mean?
3). When you try to delete a tag, Git needs to locate it either locally or on a remote repository. Errors occur when Git cannot find the tag, when there's ambiguity with branch names, or when the remote server blocks the deletion.
How do I fix "error: tag 'v1.0.0' not found / remote rejected (pre-receive hook decl"?
Git tag deletion errors occur when the tag doesn't exist, when a branch has the same name, or when server-side protections prevent deletion. Solutions depend on whether you're deleting local or remote tags.
What causes "error: tag 'v1.0.0' not found / remote rejected (pre-receive hook decl"?
The tag doesn't exist locally (only exists on remote, or was never fetched) Tag name is identical to a branch name, causing refspec ambiguity The tag is protected on GitLab/GitHub and cannot be deleted via git push
Is the "error: tag 'v1.0.0' not found / remote rejected (pre-receive hook decl" error serious?
It is a low-severity error โ€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading