Hard Merging in git

非 Y 不嫁゛ 提交于 2019-11-28 02:07:49

问题


I want to merge a branchA with the master branch such that in case of any conflict branch A overrides the master branch.

Basically I want to replace the master branch by branch A

Any idea?


回答1:


you can try a:

git checkout master
git merge -Xtheirs branchA

(as described in "git merge -s ours, what about “their”":
This would avoid the merge -ours from master to branchA, followed by the merge from branchA to master described in "How to replace master branch in git, entirely, from another branch?")

You also have various other options in "git command for making one branch like another"

As mentioned in "Git: Merge to master while automatically choosing to overwrite master files with branch", a reset would also be possible to completely replace master by branchA.



来源:https://stackoverflow.com/questions/13307303/hard-merging-in-git

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