git blame:合并后的正确作者 [英] git blame: correct author after merge

查看:459
本文介绍了git blame:合并后的正确作者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GIT合并引入了一个新的提交。这会导致git blame的问题:合并后的行似乎由合并的开发人员提交。



我可以理解这是冲突的变化(因为他解决了冲突)。但是有没有办法避免这种情况发生在非冲突的线上?一些选项git blame?



如果没有办法解决,那么当您进行大量合并时,这基本上会让git blame几乎无用 - 而GIT鼓励进行大量合并。



SVN是否存在非冲突合并的问题?我不这么认为,但我可能是错的,因为我(理解)在使用SVN时避免了像鼠疫一样的分支。

>内部 git blame 使用 git rev-list 来创建版本列表。和 git rev-list 接受 - 不合并选项。



所以你可以这样做:

  git blame --no-merges< file> 


A GIT merge introduces a new commit. This causes problems with "git blame": the merged lines appear to be committed by the developer that did the merge.

I can understand this being the case for conflicting changes (because he solved the conflicts). But is there a way to not have this happening for non-conflicting lines? Some option to "git blame"?

If there is no way around, this would basically make "git blame" almost useless when you have a lot of merges - and GIT encourages a lot of merges.

Does SVN have this issue with non-conflicting merges? I don't think so, but I may be wrong as I (understandingly) avoided branches like plague when working with SVN.

解决方案

Internally git blame uses git rev-list to create the revision list. And git rev-list accepts the --no-merges option.

So you can do:

git blame --no-merges <file>

这篇关于git blame:合并后的正确作者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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