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:
- Git Push Error: rejected error: failed to push some refs to… [How to Solve]
- How to Solve Error: failed to push some refs to git
- How to Solve error: failed to push some refs to ‘xxxx’
- error: failed to push some refs to ‘https://gitee.com/XXXX/ui-demo.git’
- [Solved] error: failed to push some refs to ‘xxxx’
- Git Push hint: Updates were rejected because the remote contains work that you do hint: not have …
- Git | fatal: refusing to merge unrelated histories [How to Solve]
- Git push Updates were rejected because the tip of your current branch is behind
- error: src refspec master does not match any [How to Solve]