Git拒绝了非快进

时间:2016-04-11 18:49:08

标签: git github

我在本地拥有的是正确的东西,这意味着我只想覆盖群组主人的所有内容,如果群组中的其他成员在群组主人身上有变化。有谁知道我怎么做到这一点?我收到以下错误。 (我只是想把我所拥有的东西推到集团主人那里,忽略其他成员在集团主人身上所做的所有改变。)

它提到“整合远程变化”,但我不想这样做。我不想要任何远程更改。

  $ git push group master

To git@github.com:name/groupNum.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:name/groupNum.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and 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 branch
  1
  some_name
  master
  random
* project2

当我使用提交消息执行git push -f group master时,而不是使用我的提交消息推送我想要推送的内容(我的所有更改),它只执行以下操作,它将我们的repo恢复为提交a几个月前:“恢复”恢复“完成任务2”“这恢复提交86 ## 6e9。”为什么“恢复...”,这甚至不是我的提交消息。我现在该如何解决这个问题?

2 个答案:

答案 0 :(得分:2)

此消息表示某人已发布了共享您分支上新提交的共同祖先的提交。

如果你知道这些提交是什么,并希望用你的提取完全覆盖它们,你可以使用git push标志git push -f group master

Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("_","") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace(" ","") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("hp","HP ") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("HP","HP ") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("Hp","HP ") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("&"," & ") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("a","A") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("b","B") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("c","C") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("d","D") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("e","E") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("f","F") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("g","G") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("h","H") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("i","I") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("j","J") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("k","K") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("l","L") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("m","M") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("n","N") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("o","O") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("p","P") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("q","Q") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("r","R") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("s","S") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("t","T") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("u","U") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("v","V") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("w","W") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("x","X") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("y","Y") } Get-ChildItem -recurse -name | ForEach-Object { Move-Item $_ $_.replace("z","Z") }

答案 1 :(得分:0)

如果您要放弃其他成员所做的其他更改,则需要强制进行更改。

我建议您抓取所有内容并为代码压缩

请在执行前阅读

git push group master --force