10/19/2026
Git Push Error: dst refspec matches more than one
The remote already has two refs ending in the name you pushed to, almost always a branch and a tag, so Git cannot tell which you mean. Name the destination in full:
git push origin HEAD:refs/heads/release
Use HEAD:refs/tags/release instead if you meant the tag. Replace release with the name in your error.
Confirm the cause
git ls-remote origin refs/heads/release refs/tags/release
Two lines back is the collision. With Git 2.56.0 (Windows) it printed refs/heads/release and refs/tags/release. Locally, git show-ref release lists every match, remote-tracking refs included.
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.
Three similar errors, three causes
All three were reproduced in a throwaway repository.
| Error text | Cause | Fix |
|---|---|---|
dst refspec release matches more than one |
The destination matches two refs on the remote | Push to refs/heads/NAME or refs/tags/NAME |
src refspec release matches more than one |
The name you pushed matches two refs locally | git push origin refs/heads/release:refs/heads/release |
src refspec main does not match any |
No local ref by that name: no commit yet, or a misspelled branch | Make a commit, or push the name git branch shows |
An empty repository and a wrong branch name, often listed as causes of the dst error, produce the third error. With no commits, git push origin main printed src refspec main does not match any; so did the typo mian.
Why Git refuses to pick
The git-push documentation says that if the destination unambiguously names a ref on the remote, Git expands it: with a remote tag v1.0, HEAD:v1.0 becomes HEAD:refs/tags/v1.0. If it cannot, it errors out and, depending on advice.pushUnqualifiedRefname, may suggest a namespace. The docs describe the fully expanded form, such as refs/heads/main:refs/heads/main.
Locally the rule differs. The gitrevisions manual resolves an ambiguous name to the first match in an ordered list, and refs/tags/<name> precedes refs/heads/<name>. So git rev-parse release returns the tag and prints warning: refname 'release' is ambiguous. A push has no such default; the docs state only the behavior.
Forms that fail
| Command, with both refs on the remote | Result |
|---|---|
git push origin HEAD:release |
dst error |
git push origin main:release |
dst error |
Raw commit hash to :release |
dst error |
git push origin release (only a local branch release) |
Succeeded |
The colonless form is why the error often appears only after someone adds a colon. That was observed, but no documentation explaining it was found. It succeeds only while no local tag named release exists: with a local tag as well, the same push fails with src refspec release matches more than one.
Fix it for good
Delete the tag you did not want, using the empty-source form the docs describe:
git tag -d release
git push origin :refs/tags/release
Deleting a remote tag affects everyone relying on it, so check first. Afterward git ls-remote origin showed only refs/heads/release. Then give tags a pattern a branch will not use, such as v4.2.0 or release-2026-11-25. Names must satisfy git check-ref-format, which forbids spaces, ~, ^, :, ?, *, [, .., @{, and a trailing . or .lock; git check-ref-format --branch "bad name" failed when tried.
Sources
- git-push: https://git-scm.com/docs/git-push (text from Git 2.55.0)
- gitrevisions: https://git-scm.com/docs/gitrevisions
- git-check-ref-format: https://git-scm.com/docs/git-check-ref-format
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.