DEV Community

Andreas Bergström
Andreas Bergström

Posted on

error: src refspec refs/heads/foo matches more than one

If you are getting this error when trying to push a local branch to its remote, it typically means you have tags and branches with the same names. Do:

git tag
Enter fullscreen mode Exit fullscreen mode

And then delete the tag with the same name as the branch you are trying to push

git tag -d refs/heads/production
Enter fullscreen mode Exit fullscreen mode

And thereafter avoid using same names for branches and tags as both git and any GUI tools usually run into issues in that scenario.

Top comments (0)