Always use version from merged branch on conflicts

前端 未结 2 2003
不思量自难忘°
不思量自难忘° 2020-12-15 00:27

Currently I am working in a feature branch that will soon be merged back into master. I recently tried just that and had some merge conflicts, which I had to fix manually. <

2条回答
  •  一整个雨季
    2020-12-15 00:58

    You can't use the recursive "ours" strategy. It would omit your changes that didn't conflict.

    You could script getting the file names of the conflicted files, and do a git checkout --ours -- filename followed by a git add filename.

    If you're getting the same conflicts over and over, turn on rerere and that may be enough so you don't have to resolve the conflicts.

    Hope this helps.

提交回复
热议问题