在拉取期间解决 Git 合并冲突以支持其更改 [英] Resolve Git merge conflicts in favor of their changes during a pull

查看:27
本文介绍了在拉取期间解决 Git 合并冲突以支持其更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解决 git 合并冲突以支持拉取更改?

How do I resolve a git merge conflict in favor of pulled changes ?

基本上我需要从工作树中删除所有冲突的更改,而不必通过 git mergetool 处理所有冲突,同时保持所有无冲突的更改.最好在拉动时这样做,而不是之后.

Basically I need to remove all conflicting changes from a working tree without having to go through all of the conflicts with a git mergetool while keeping all conflict-free changes. Preferably doing this while pulling, not afterwards.

推荐答案

git pull -s recursive -X theirs <remoterepo or other repo>

或者,简单地说,对于默认存储库:

Or, simply, for the default repository:

git pull -X theirs

如果您已经处于冲突状态...

git checkout --theirs path/to/file

这篇关于在拉取期间解决 Git 合并冲突以支持其更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆