在git reset之后--hard <id>我该如何提交?

时间:2018-01-24 17:05:30

标签: git github

我不小心犯了错误的项目,所以我必须git reset --hard <id>才能完成最后一次提交。现在我的文件是我在repo中想要它们的方式。当我尝试提交时,我收到了消息。

error: failed to push some refs to 'https://github.com/ohabash/Bulma-grunt-admin.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. ML-2PG8WN:Bulma-grunt-admin ohabash$

如何提交我文件系统中当前的内容。或者我如何简单地撤消错误提交。

1 个答案:

答案 0 :(得分:0)

好的我正试图git push我收到错误error: failed to push some refs to 'https://github.com/ohabash/Bulma-grunt-admin.git'

我应该做git push -f强迫推送到远程。

http://christoph.ruegg.name/blog/git-howto-revert-a-commit-already-pushed-to-a-remote-reposit.html