问题
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