Skip to content

Instantly share code, notes, and snippets.

@xros
Created January 21, 2022 00:59
Show Gist options
  • Save xros/c9668ff5608f83b036989a70b4c5c8ca to your computer and use it in GitHub Desktop.
Save xros/c9668ff5608f83b036989a70b4c5c8ca to your computer and use it in GitHub Desktop.
Resolved: error: dst refspec refs/heads/main matches more than one

If you have this error, when you are pushing some codes to git server:

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

It might be that you locally/remotely has a tag called refs/heads/main

I believe you don't want this tag.

How to delete this tag both on remote git server and locally?

  1. delete tag on remote git server git push origin :refs/tags/'refs/heads/main'
  2. delete tag on locally git tag -d 'refs/heads/main'

Don't forget the ' mark, that's why I had this error from the beginning.

Then go push your codes to any branch you want. Fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment