硬合并在git中 [英] Hard Merging in git

查看:100
本文介绍了硬合并在git中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 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 A

Any idea?

解决方案

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.

这篇关于硬合并在git中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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