我如何在不看到合并的情况下怪罪 [英] How do I git blame without seeing merges

查看:71
本文介绍了我如何在不看到合并的情况下怪罪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我有一个历史记录如下的文件:

If I've got a file whose history is like this:

----A----B
     \    \
      C----D----E

然后由E​​负责,然后我想看看B和A修订版中发生了什么变化. C,但是我并不在乎D,因为那是合并.

and I do a blame from E then I'd like to see what changed in revisions B & C, but I don't really care about D, since that was a merge.

有没有办法做到这一点?我想我正在寻找某种git怪的--no-merges选项,但是在

Is there a way I can do this? I guess I'm looking for some kind of --no-merges option to git blame, but I'm not seeing one in the manual.

推荐答案

实际上,您确实关心D.请考虑这种情况:

Actually, you do care about D. Consider this case:

in commit B:
2) banana
3) coconut
4) domino     // conflicts with C

in commit C:
2) banana
3) coconut
4) elephant   // conflicts with B

在提交D中,我们解决了冲突:

In commit D, we resolve the conflict:

in commit D:
2) banana
3) coconut
4) domino-elephant

请注意,在D中,出现了一条未出现在B或C中的行.如果忽略合并,您将永远不会看到,也永远无法分辨第4行来自何处​​.不好.

Notice that in D, a line appears which didn't appear in either B or C. If you ignore merges, you would never see that, and you'd never be able to tell where line 4 came from, which is bad.

这篇关于我如何在不看到合并的情况下怪罪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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