Github,我的分支在主人后面,但它是正确的。如何覆盖分支的主人? [英] Github, my branch is behind master but it is correct. How do I overwrite master with the branch?
问题描述
这些是我在去这个问题的路上所做的一些步骤:
$ b
我的分支A只有300次提交,后面900次提交。但是,我在分支A上删除的900个提交是重复的。我怎么才能让主人有300分支提交像分支A?
请参阅原始问题:如何从git上的filter-branch命令中删除重复的提交? 这似乎没有奏效: 所以我做了: 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? See original question: How to remove duplicated commits from filter-branch command on git? This didn't seem to be working: So I did:
这篇关于Github,我的分支在主人后面,但它是正确的。如何覆盖分支的主人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
git checkout master
git reset --hard correct_branch
git push -f origin master
git checkout master
git reset --hard old_commit_id_from_master
git push -f来源大师
git checkout master
git reset --hard correct_branch
git push -f origin master
git checkout master
git reset --hard old_commit_id_from_master
git push -f origin master