Git Gui我不能推向Github

问题描述 投票:-2回答:3

我无法将我的文件推送到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 github crash-reports
3个回答
0
投票

你要么:

  1. git pull ...,尝试合并并解决冲突,如果有的话,那么你将能够git push
  2. git push -f ...。但要小心这个,只有在重新设置本地存储库并想要推送到非公共分支时才应该使用它。

如果您不确定该怎么做,第一个是最安全的选择。


1
投票

请阅读邮件:

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.

在推送更改之前,您必须先进行远程更改。


0
投票

我有同样的问题 。

我用了

    git push origin master --force

它完美无缺。

© www.soinside.com 2019 - 2024. All rights reserved.