[Solved] gitee Push Error: error: failed to push some refs to

Today, I created a project in gitee to push the local code. I found an error. The error is as follows:

error: failed to push some refs to 'https://gitee.com/xxxx'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

Analysis reason:

Because readme The MD file is not in the local code directory

Solution:

Execute the following command to set readme MD pull to local

git pull --rebase origin master

Then execute the following command to push the file

git push origin master

Similar Posts: