Github不允许我推进分支机构

时间:2016-04-15 19:01:38

标签: git

在尝试推送回购时,我得到以下内容:

To https://github.com/Ekultek/whitewidow.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'https://github.com/Ekultek/whitewidow.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.

我很困惑,为什么它不允许我推?

让我们回顾一下我如何到达这里:

我更改了大约300行代码,已经撤消了另一个存储库,并且看到了整个>>>>>HEAD + >>>>>>324240283<random-numbers>

然而,当我尝试它时仍然无法推送给我相同的输出:

C:\Users\Justin\myscripts\rubysql\whitewidow [master +2 ~1 -0 !]> git pull https://github.com/Ekultek/whitewidow
remote: Counting objects: 169, done.
remote: Compressing objects: 100% (30/30), done.
Receiving objects:  92% (156/169)   al 169 (delta 14), reused 3 (delta 3), pack-reused 136
Receiving objects: 100% (169/169), 56.76 KiB | 0 bytes/s, done.
Resolving deltas: 100% (86/86), completed with 2 local objects.
From https://github.com/Ekultek/whitewidow
 * branch            HEAD       -> FETCH_HEAD
warning: Cannot merge binary files: README.md (HEAD vs. 281bf372e265d81c0b020747e59eb7935c339d78)
Auto-merging whitewidow.rb
CONFLICT (content): Merge conflict in whitewidow.rb
Auto-merging log/non_exploitable.txt
CONFLICT (content): Merge conflict in log/non_exploitable.txt
Auto-merging log/error_log.LOG
CONFLICT (content): Merge conflict in log/error_log.LOG
Auto-merging log/SQL_VULN.LOG
CONFLICT (content): Merge conflict in log/SQL_VULN.LOG
Auto-merging lib/spider.rb
CONFLICT (content): Merge conflict in lib/spider.rb
Auto-merging lib/search_query.txt
CONFLICT (content): Merge conflict in lib/search_query.txt
Auto-merging lib/rand-agents.yaml
CONFLICT (content): Merge conflict in lib/rand-agents.yaml
Auto-merging lib/legal.rb
CONFLICT (content): Merge conflict in lib/legal.rb
Auto-merging lib/credits.rb
Auto-merging lib/copy.rb
Auto-merging docs/COPYRIGHT.md
CONFLICT (add/add): Merge conflict in docs/COPYRIGHT.md
Auto-merging docs/CHANGELOG.md
CONFLICT (add/add): Merge conflict in docs/CHANGELOG.md
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Auto-merging Gemfile
CONFLICT (add/add): Merge conflict in Gemfile
Automatic merge failed; fix conflicts and then commit the result.
C:\Users\Justin\myscripts\rubysql\whitewidow [master +5 ~2 -0 !9 | +5 ~1 -0 !9 !]> git push
To https://github.com/Ekultek/whitewidow.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/Ekultek/whitewidow.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.

3 个答案:

答案 0 :(得分:0)

回购中有一些新的变化,你不能只是推,你首先需要拉新的变化,之后你就不能推了。

另一方面,你可以用git push -f强制推送,但我认为你不想这样做.. :)

答案 1 :(得分:0)

原始存储库已更新,您尚未更新本地存储库。更新本地存储库的典型方法是使用命令git push <remote> <branch>,如果您刚刚创建了存储库并且没有创建任何分支或远程,那么您可以将git push origin master放入命令行(gitbash或linux,不确定Mac,不认为它可以在Windows上运行)在包含.git文件的目录中。

如果您使用GUI工具来处理git,那么通常会有一个按钮,表示&#34; pull&#34;。单击此按钮,然后再次尝试按。

答案 2 :(得分:0)

您的远程存储库中有一些提交,您的本地存储库没有,并且您首先提取它。我认为有人已将新提交推送到您的远程仓库,您必须先将其提取以推送您的提交。

相关问题