Git merge with force overwrite

前端 未结 6 663
悲哀的现实
悲哀的现实 2021-01-29 19:03

I have a branch called demo which I need to merge with master branch. I can get the desired result with following commands:

git pull or         


        
6条回答
  •  鱼传尺愫
    2021-01-29 19:51

    You can try "ours" option in git merge,

    git merge branch -X ours

    This option forces conflicting hunks to be auto-resolved cleanly by favoring our version. Changes from the other tree that do not conflict with our side are reflected to the merge result. For a binary file, the entire contents are taken from our side.

提交回复
热议问题