error: src refspec master does not match any [How to Solve]

Summary

Solve the problem in one sentence:

Enter first

git push -u origin main

Then enter

 git config http.sslVerify "false"

Then enter

git push -u origin main

Problem background

When uploading a project to GitHub, enter the command:

git push -u origin master

report errors:

error: src refspec master does not match any

First attempt to solve

I found an answer on the Internet:

git push -u origin main

Error is still reported after input:

OpenSSL SSL_read: Connection was reset, errno 10054

Try again

Another answer was found:

 git config http.sslVerify "false"

No error is reported
Enter again:

git push -u origin main

The screenshot below shows that the upload was successful

Read More: