我想将分支A
与master
分支 merge ,以便在发生任何冲突时分支A
覆盖master
分支。
基本上我想用分支A
替换master分支
有什么想法吗?
最佳答案
你可以尝试:
git checkout master
git merge -Xtheirs branchA
(如“git merge -s ours
, what about “their
””中所述:
这将避免从 master
到 branchA
的 merge -ours
,然后再从 branchA
merge 到 master
在“How to replace master branch in git, entirely, from another branch?”中描述)
“git command for making one branch like another”中还有各种其他选项
正如“Git: Merge to master while automatically choosing to overwrite master files with branch”中提到的,重置也可以用branchA
完全替换master
。
关于git - git 中的硬 merge ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13307303/