我无法将我的文件推送到Github。错误:
Pushing to https://github.com/Brogolem35/project.git
To https://github.com/Brogolem35/project.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/Brogolem35/project.git'
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.
我不知道如何解决它。我也试过Git Bash。它给了我同样的问题。
你要么:
git pull ...
,尝试合并并解决冲突,如果有的话,那么你将能够git push
或git push -f ...
。但要小心这个,只有在重新设置本地存储库并想要推送到非公共分支时才应该使用它。如果您不确定该怎么做,第一个是最安全的选择。
请阅读邮件:
error: failed to push some refs to 'https://github.com/Brogolem35/project.git'
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.
在推送更改之前,您必须先进行远程更改。
我有同样的问题 。
我用了
git push origin master --force
它完美无缺。