git - git 中的硬 merge

标签 git merge branch

我想将分支Amaster分支 merge ,以便在发生任何冲突时分支A覆盖master 分支。

基本上我想用分支A替换master分支

有什么想法吗?

最佳答案

你可以尝试:

git checkout master
git merge -Xtheirs branchA

(如“git merge -s ours, what about “their”中所述:
这将避免从 masterbranchAmerge -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/

相关文章:

windows - Windows 上的 Git 和文件属性

git - 对于 Codeception 测试,git 中应该提交或忽略什么?

svn - 如何使用新的 SVN 合并跟踪?

git - 警告 : Not setting branch master as its own upstream

git - 仅在 Jenkins 的新分支上触发构建?

version-control - 版本控制 (TFS) : Need advice 的两种方法

git - 将 GIT 存储库中的文件标记为暂时忽略

git - git 如何使用它对 blob 和树的权限

merge - ffmpeg 合并 mxf 音频和 m2v 视频

sql - 合并更新查询未按预期执行的问题