Contents

10/06/2026

Git Push Error: dst refspec matches more than one

Short answer: the remote has both a branch and a tag with the name you pushed to, so git cannot tell which one you mean. Spell out the full reference: git push origin HEAD:refs/heads/release for the branch, or HEAD:refs/tags/release for the tag. The rest of this page shows how to confirm the cause and how to avoid it.

What the error looks like

error: dst refspec release matches more than one
error: failed to push some refs to 'origin'

"dst" is the destination half of a refspec, the part after the colon in HEAD:release. Git expands a short destination name to a full reference. When more than one reference fits, it stops and refuses to guess.

Reproduce it

We reproduced the error with Git 2.54.0 on Windows in a throwaway repository and a bare remote:

git tag release
git push origin release                 # pushes the tag
git push origin main:refs/heads/release # also creates a branch named release
git push origin HEAD:release            # error: dst refspec release matches more than one

After the third command the remote holds refs/heads/release and refs/tags/release, which git ls-remote shows side by side. The fourth command is ambiguous, so it fails.

What git is doing

Git's own documentation says that if the destination "unambiguously refers to a ref on the remote", git expands it, so with a remote tag v1.0, HEAD:v1.0 becomes HEAD:refs/tags/v1.0. If the refspec cannot be expanded unambiguously, git errors out. The documentation recommends the fully expanded form, such as refs/heads/main:refs/heads/main, to name the exact reference (git-push documentation, text from version 2.55.0).

Confirm the cause

git ls-remote origin refs/heads/release refs/tags/release

If both lines come back, a branch and a tag share the name. Replace release with the name from your error.

How to push anyway

  • Push to the branch

    `git push origin HEAD:refs/heads/release`. Updates the branch and leaves the tag alone.

  • Push to the tag

    `git push origin HEAD:refs/tags/release`. Make sure you mean to touch a tag, since people may rely on it.

  • Avoid the clash

    Do not give a branch and a tag the same name. Pick a naming rule, such as tags starting with v and branches starting with a topic word.

  • Check before deleting anything

    Removing a tag from the remote affects everyone who uses it. Look at who needs it before you do that.

One habit that avoids it

When a name could belong to a branch or a tag, write refs/heads/NAME or refs/tags/NAME. That form names exactly one reference, as the git documentation recommends.

FAQ

What does dst refspec matches more than one mean?

The destination name in your push fits more than one reference on the remote, usually a branch and a tag with the same name, and git will not choose between them.

How do I fix the error?

Push to the full reference, for example git push origin HEAD:refs/heads/release for a branch or HEAD:refs/tags/release for a tag.

How can I see whether a branch and a tag share a name?

Run git ls-remote origin refs/heads/NAME refs/tags/NAME. If both lines print, they share the name.

Researched and drafted with AI, then reviewed and edited by the site's editors.