error: failed to push some refs to 'github.com:18476305640/wx-music.git' hint: See the 'Note about fast-forwards' in 'git push --help' for details.

error: failed to push some refs to 'github.com:18476305640/wx-music.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

1)这个情况是我项目已经完成后想push到github上,于是就在github在创建了一个,且加入了 README.md ,导致无法push上去,当然你可以push到新创建的分支上。比如main分支不行,且存在一个main分支,可以git push origin master,

但如果你想在存在冲突的main上,可以在push上加-f 强行覆盖远程仓库:

git push -f  origin [远程的哪个分支]

如有错误,欢迎指定!

原文地址:https://www.cnblogs.com/zjazn/p/14685043.html