Github, my branch is behind master but it is correct. How do I overwrite master with the branch?

China☆狼群 提交于 2019-12-13 04:22:28

问题


These are the steps I did on my way to this question:

How to remove duplicated commits from filter-branch command on git?

My branch A which only has 300 commits is 900 commits behind master. However, the 900 commits that I removed on branch A are duplicates. How can I just make master have 300 commits like branch A?


回答1:


See original question: How to remove duplicated commits from filter-branch command on git?

This didn't seem to be working:

git checkout master
git reset --hard correct_branch
git push -f origin master

So I did:

git checkout master
git reset --hard old_commit_id_from_master
git push -f origin master


来源:https://stackoverflow.com/questions/47421855/github-my-branch-is-behind-master-but-it-is-correct-how-do-i-overwrite-master

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