Contents

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.

Which spellings work, tested

With a branch and a tag both named release pointing at one commit, a local repository and a bare remote, on git 2.56.0 (Git for Windows):

Command Result
git push origin release src refspec release matches more than one
git push origin release:release the same error: spelling out the destination does not help
git push origin refs/heads/release pushes the branch
git push origin heads/release pushes the branch: the shorter heads/ form is enough
git push --tags pushes the tag and never raises the error
git checkout release warning: refname 'release' is ambiguous., then switches to the branch
git push origin :release once the remote also has both dst refspec release matches more than one

That last row is how you meet the destination error without ever typing a destination: deleting a remote branch whose name a remote tag shares.

The quiet trap

After deleting the local branch with git branch -d release, git push origin release stopped erroring and answered Everything up-to-date. The name now means only the tag, which the remote already had, so there was nothing to send. No branch called release existed to push. If a push says up-to-date when you expected new commits to leave, check git branch --list release first.

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.

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