Skip to content

[Solved] error: src refspec main does not match any

If you get the following error:

error: src refspec main does not match any error: failed to push some refs to 'https://github.com/ao/xxx.git'
Code language: plaintext (plaintext)

This is because you probably haven’t committed any files to git yet!

Fix for: src refspec main does not match any

Make sure to add your files, if they have not been added yet:

git add .
Code language: Bash (bash)

Commit your files:

git commit -m "your commit message"
Code language: Bash (bash)

Push your changes to the git repo, remember to swap out the branch name as appropriate:

git push origin main
Code language: Bash (bash)

Need a deeper dive?

For more in depth information, you can visit Solved Error src Refspec Main Does Not Match

See also  [Solved] Error: Cannot find module '../lib/cli.js'
Tags:
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x