Answer the question
In order to leave comments, you need to log in
How to fix "src refspec master does not match any" error?
I created a new project with one README.md file.
And made a command
git clone https://github.com/xxxx/xxx.git
git add .
git commit -m "v.01"
git push origin master
error: src refspec master does not match any
error: failed to push some refs to https://github.com/xxxx/xxx.git
The refs 3deeeb53dda70bea0809cff5e4032011ba45ac7d / a heads / main
27383695f3f76e87254687449d73250254560bbb the refs / remotes / origin / the HEAD
27383695f3f76e87254687449d73250254560bbb the refs / remotes / origin / main
3deeeb53dda70bea0809cff5e4032011ba45ac7d the refs / remotes / origin / the master
Maybe you just need to commit. I ran into this when I did:
mkdir repo && cd repo
git remote add origin /path/to/origin.git
git add .
Oops! Never committed!
git push -u origin master
error: src refspec master does not match any.
All I had to do was:
git commit -m "initial commit"
git push origin master
Success!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question