error: src refspec master does not match anyerror: failed to push some refs to

When pushing a local project to gitee for the first time, a similar error occurs:

error: src refspec master does not match any
error: failed to push some refs to 'https://gitee.com/xxx/irojects.git'

The solution is to pull first and then push:

git pull origin master

I thought it would be OK to push again, but it’s not:

% git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

Then you still have to operate like this:

git push -u origin master

Successful push!

Welcome to my official account and exchange study.

Read More: