本文介绍了硬合并在git中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我想用 master 分支合并一个分支 A ,这样如果有任何冲突分支 A 会覆盖 master 分支。 基本上我想用分支 A 替换主分支 任何想法?解决方案您可以尝试一下: pre> git checkout master git merge -X他们的分支A git merge -s我们的,> : 这会避免合并-ours 从 master 到 branchA ,然后从中描述的到 master master-branch-in-git-completely-from-another-branch>如何从其他分支完全替换git中的master分支?) 正如在中提到的那样,你可以通过重置来完全替换 code> master by branchA 。 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 AAny idea? 解决方案 you can try a:git checkout mastergit 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. 这篇关于硬合并在git中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-21 03:30