One minute
Git Failed to Push Some Refs
Quick solution for resolving the common Git error 'failed to push some refs' by inspecting remote branches and rebasing safely.
Most of the times git is verbose enough when giving error messages so you can easily go through the situation. But today I faced one that it’s 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.