Hard Merging in git

前端 未结 1 1397
情话喂你
情话喂你 2020-12-18 13:46

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

相关标签:
1条回答
  • 2020-12-18 14:18

    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.

    0 讨论(0)
提交回复
热议问题