Trouble pushing to origin after local hard reset

人盡茶涼 提交于 2019-12-02 09:59:10
TimWolla

You can push --force to override the current HEAD of the origin, even if your local branch is not a descendant of it.

However: You should be aware of the consequences: Other developers working on the same repository now cannot easily pull in the changes, but have to reset / rebase to the origin. Using forced pushes / rewriting pushed history is bad and should be avoided whenever possible.

See also another answer here on StackOverflow on the dangers of forced pushes: How to properly force a Git Push?

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!