3 回答
TA贡献1804条经验 获得超7个赞
您可以使用递归“他们的”策略选项:
git merge --strategy-option theirs
从男人:
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.
This should not be confused with the ours merge strategy, which does
not even look at what the other tree contains at all. It discards
everything the other tree did, declaring our history contains all that
happened in it.
theirs
This is opposite of ours.
注意:正如手册页所述,“我们的”合并策略选项与“他们的”合并策略非常不同。
TA贡献1876条经验 获得超6个赞
git pull -s recursive -X theirs <remoterepo or other repo>
或者,简单地,对于默认存储库:
git pull -X theirs
如果您已经处于冲突状态...
git checkout --theirs path/to/file
TA贡献2036条经验 获得超8个赞
如果您已经处于冲突状态,并且只想接受他们所有的状态:
git checkout --theirs .
git add .
如果要执行相反的操作:
git checkout --ours .
git add .
这太剧烈了,因此请确保您确实要在执行此操作之前先将所有内容清除掉。
- 3 回答
- 0 关注
- 506 浏览
添加回答
举报