Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
GIT 合并引入了一个新的提交。这会导致“git blame”出现问题:合并的行似乎是由进行合并的开发人员提交的。
我可以理解这是冲突更改的情况(因为他解决了冲突)。但是有没有办法让不冲突的行不发生这种情况?“git责备”的一些选择?
如果没有办法,当您进行大量合并时,这基本上会使“git blame”几乎无用 - 而GIT鼓励大量合并。
SVN 是否存在非冲突合并的问题?我不这么认为,但我可能是错的,因为我在使用 SVN 时(可以理解地)避免了像瘟疫这样的分支。
内部git blame用于git rev-list创建修订列表。并git rev-list接受该--no-merges选项。
git blame
git rev-list
--no-merges
所以你可以这样做:
git blame --no-merges <file>
我刚刚尝试与 git 版本 2.3.8 合并,非合并冲突行不归于合并提交作者,它们归于原作者。也许自从您的 git 版本以来,这个问题已经得到解决。