我想回滚到之前的提交。所以,我在本地存储库中做了git reset --hard sha1
,当我将它推送到远程主存储库时,它给了我这个
git push docs master
To https://github.com/sathya9897/docs.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/sathya9897/docs.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.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
因为它说我的主人在一些提交之前,但我想将主人回滚到我在本地存储库上的当前提交。 如何将远程主存储库重置为先前的提交?
答案 0 :(得分:0)
你需要强制推送:git push docs +master
。您应该考虑您的回购的可能用户以及他们是否可以应对上游修订消失,这就是音乐匹配可能指的内容。有时,发布某些内容会带来某些隐含的保证,这些保证可能会被这样做所打破。