我使用私人github回购项目作为我唯一的开发人员。在本地重新绑定提交后推送到远程提交
昨天,在将我最新的变化推向github之后,我决定试着用我的一些本地承诺来重新清理一些东西。我跟着Github's rebase tutorial并没有听从顶部的警告:
警告:它被认为是不好的做法,衍合你已经被推到远程仓库提交。这样做可能会引起git神的愤怒。
挤压一些提交之后,我试着一推,并得到了这一点:
$ git push origin master
To [email protected]:me/my-repo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:me/my-repo.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
好吧,这要我合并远程变化,但我还没有做出任何所以我会忽略。纵观帮助部分,它看起来像我不得不强迫带推的选项:
git push --force
考虑没有其他人已经触及远程回购,还有的是我的最后一次推动和重订基期之间没有任何变化,这是可以做,还是会有后果?
由于这是一个私人回购,并且您是唯一使用它的人,所以强行推送可能没问题。只是不要成为一种习惯。 :-) – peterjmag