我如何知道哪些Git提交会导致冲突? [英] How can I find out which Git commits cause conflicts?

查看:185
本文介绍了我如何知道哪些Git提交会导致冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将上游更改合并到我的项目中,最近有很多提交创建了很多合并冲突。试图一次性解决它们是没有意义的。



如何找出哪些提交会产生冲突?以下任何一种都是可以接受的:


  • 一种让Git在发现冲突后立即停止合并的方法

  • 使Git按时间顺序列出冲突的所有提交的一种方法

  • 其他任何让我按时间顺序逐个解决冲突的方法,不涉及合并几次提交,希望能够偶然发现冲突
  • 可以尝试 git imerge :这将适用于您的提交一个,让你有机会做一个rebase 增量(这意味着你可以开始rebase,打断它,稍后恢复!)。

    你可以在这里看到增量合并vs.直接合并与rebase


    I'm merging upstream changes to my project, and recently there were a lot of commits that created a lot of merge conflicts. It doesn't make sense to try to resolve them all at once.

    How can I find out which commits create a conflict? Any of the following are acceptable:

    • A way to make Git stop merging as soon as it finds a conflict
    • A way to make Git list all the commits that conflicted, in chronological order
    • Anything else that lets me resolve the conflicts one-by-one, in chronological order, that doesn't involve merging a few commits at a time hoping to stumble upon the conflicts

    解决方案

    You can gives git imerge a try: that will apply your commits one by one, giving you the chance to do a rebase incrementally (meaning you can start a rebase, interrupt it, resume it later!).

    You can see here a comparison between Incremental merge vs. direct merge vs. rebase.

    这篇关于我如何知道哪些Git提交会导致冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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