09/27/2026

Git: src refspec matches more than one

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

Your local repository has two refs with that name, almost always a branch and a tag, and git push origin release can't tell which one to send. Push the branch by its full name, git push origin refs/heads/release, or rename the tag.

What "src" means here

A push refspec is <src>:<dst>, as the git push documentation describes: the source is a ref in your repository and the destination is a ref on the remote. When you type a short name, git looks it up locally, finds both refs/heads/release and refs/tags/release, and refuses rather than guess. The sibling error, dst refspec matches more than one, is the same collision on the destination side.

See which refs collided:

git show-ref release
c0c18ee... refs/heads/release
c0c18ee... refs/tags/release

Other commands only warn. git checkout release prints warning: refname 'release' is ambiguous. and carries on, which is usually how the tag goes unnoticed until the push.

The fix

Keep both and push the one you meant. Spell the source out:

git push origin refs/heads/release
git push origin refs/tags/release

The first sends the branch, the second the tag. While the branch is checked out, git push origin HEAD also works, because HEAD isn't ambiguous.

The tag was a mistake. Delete it locally, then push as usual:

git tag -d release
git push origin release

You want the tag under a better name. Create the new tag from the full ref, because a bare release is still ambiguous and git resolves it to the tag, not the branch (gitrevisions checks refs/tags/ before refs/heads/):

git tag release-v1 refs/tags/release
git tag -d release
git push origin release-v1

If the old tag was already pushed, remove it from the remote with git push origin :refs/tags/release.

How to verify

git show-ref release should list a single ref, and a plain git push origin release should go through. I reproduced the error and each fix above in a throwaway repository with git 2.54. For the rest of the everyday commands, see the Git cheat sheet.

Questions this raises

What is the difference between the src and dst refspec errors?

src means the name is ambiguous in your own repository, the thing being sent. dst means the name is ambiguous on the destination side, the ref being written on the remote. The fix is the same idea: use the full refs/heads/ or refs/tags/ name.

Which ref does git pick when a name is ambiguous?

Commands that resolve a revision check refs/tags/<name> before refs/heads/<name> and print a warning. git push refuses instead, because sending the wrong one is hard to undo.

How do I stop this happening again?

Give tags names a branch can't have, such as v1.4.0 or release-2026-09-27. A branch is where work happens and a tag marks a moment, so if the two share a name, one of them is misnamed.