Tag Archives: Git Common Error

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

Solution:


master-wei@DESKTOP-HDUPJ4Q 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'


master-wei@DESKTOP-HDUPJ4Q MINGW64 /g/browser/blog/myblog (main)
$ git config --global --unset http.proxy

master-wei@DESKTOP-HDUPJ4Q MINGW64 /g/browser/blog/myblog (main)
$ git config --global --unset https.proxy 

master-wei@DESKTOP-HDUPJ4Q 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