[Solved] Git Common Error: error: src refspec xxx does not match any/error: failed to push some refs to

Solution:


[email protected] MINGW64 /g/browser/blog/myblog (main)
$ git push origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://github.com/w13411965905/myblog.git'


[email protected] MINGW64 /g/browser/blog/myblog (main)
$ git config --global --unset http.proxy

[email protected] MINGW64 /g/browser/blog/myblog (main)
$ git config --global --unset https.proxy 

[email protected] MINGW64 /g/browser/blog/myblog (main)
$ git push origin main
Enumerating objects: 4, done.
Counting objects: 100% (4/4), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 35.82 MiB | 1.62 MiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0

reason:

The default main branch name of GitHub is main

Therefore, the push command should be git push origin main

Read More: