One minute
Git Failed to Push Some Refs
How to fix the Git 'src refspec main does not match any' and 'failed to push some refs' error when pushing an empty repository before creating the first commit.
Most of the time Git is verbose enough when giving error messages so you can easily go through the situation. But today I faced one that is not that well communicated.
I was setting up a new repository on GitHub and when I executed the command git push -u origin main I got:
error: src refspec main does not match any
error: failed to push some refs to 'github.com:AlbertMorenoDEV/this-is-an-example.git'
It turned out that I was missing to create the very first commit so git didn’t have any commit to point and upload.