2013-02-17 14 views
-1

今天早些时候,我执行了git reset --hard 12345abc以将本地副本恢复为特定提交。现在,当我试图推动原产地掌握新的变化,我收到以下错误:Git在执行git重置后在本地开发环境中发生错误--hard

注:“12345ABC”上面是一个例子提交数

error: failed to push some refs to '[email protected]:example/example.git' 
hint: Updates were rejected because the tip of your current branch is behind 
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull') 
hint: before pushing again. 
hint: See the 'Note about fast-forwards' in 'git push --help' for details. 

我如何可以继续提交我的新变化,并推动他们的起源大师?

+0

你看了' git push --help',因为它建议?或试图在Google上搜索?这是一个常见的错误,并且经常被问到。在问这里问题之前,您应该始终使用搜索工具。 – 2013-02-18 06:39:51

回答

4
$ git push -f 

将解决您的问题。

注:除非其他的提交提及,分支或标签,12345abc及其所有子承诺将垃圾收集(因为没有引用它们了,Git会假定他们是没用的)