Error-: src refspec main does not match any
This error message usually indicates that the branch you're attempting to push does not exist.
Solution-1
Check if you have missed the command git add .
or git commit -m"message
. If so, then delete the terminal and write the git commands again.
Solution-2
Step 1: Go to GitHub Settings and then go to Emails
Step-2: Uncheck Keep my email addresses private
Step-3: Push your code again
Solution-2
Open your Git bash terminal and run the following commands one by one:
rm -rf .git git init git add . git commit -m "added" git branch -M main git remote add origin <YOUR_GITHUB_REPO_LINK> git push -u origin main -f Happy Coding!
Top comments (0)