Member-only story

How to resolve “error: dst refspec refs/heads/main matches more than one” error when you push from local git

Bryant Jimin Son
2 min readJan 31, 2023

--

Error you can get when you push

Although it is rare, you can get an error like this when you try to push your changes from your local directory to your repository:

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

This can happen when there is a conflicting tag with the same name in your local environment. Or, it might look like this.

error: dst refspec refs/heads/main matches more than one

In the case above, that can happen because you have a conflicting tag in your destination environment, which is usually your repository.

What happens is that you previously createsgit tagtags, whether they are in remote or local, that have that conflicting refspecs.

Let’s first check local tags with the following commands:

git tags --list

You will see a list of tags like this.

To exist, hit keyboard button Q.

If you do see the conflict tag, you can delete local tag with a command like this.

--

--

Bryant Jimin Son
Bryant Jimin Son

Written by Bryant Jimin Son

A cloud practitioner talking about technology, travels & career tips. But I will sometimes cover financial advises and some random stuffs.

No responses yet