Github,我的分支在主人后面,但它是正确的。如何覆盖分支的主人? [英] Github, my branch is behind master but it is correct. How do I overwrite master with the branch?

查看:167
本文介绍了Github,我的分支在主人后面,但它是正确的。如何覆盖分支的主人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些是我在去这个问题的路上所做的一些步骤:

$ b如何从git的filter-branch命令中删除重复的提交?
$ b

我的分支A只有300次提交,后面900次提交。但是,我在分支A上删除的900个提交是重复的。我怎么才能让主人有300分支提交像分支A?

解决方案

请参阅原始问题:如何从git上的filter-branch命令中删除重复的提交?

这似乎没有奏效:

  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来源大师


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:

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

这篇关于Github,我的分支在主人后面,但它是正确的。如何覆盖分支的主人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆