[英]How to find the files changed in one branch when another has been merged into it (ignoring changes from the merged branch)?
I have been working on a feature with a few colleagues on a branch "b1", this work has gone on over a few months and somebody decided to merge in the changes from master to try and reduce the possibility of merge conflicts further down the line. 我一直在与“ b1”分支上的几个同事一起开发功能,这项工作已经进行了几个月,有人决定合并master的更改,以尝试减少合并冲突的可能性。
|
|\
| \
| \ (branch point)
| |
| |
| |
|___| (merge)
| |
| |
| | (current state)
(b1)
Work had been ongoing on master before it was merged into b1. 在母版合并到b1中之前,它一直在进行中。 I would like to know what files have been changed ONLY in b1, ignoring all of the commits which are now in the history of b1 which were brought in by merging master in.
我想知道b1中仅更改了哪些文件,而忽略了b1历史中由master合并带来的所有提交。
I have tried using various git log options to do so such as the --no-merges option, which seems to only ignore the actual merge commits. 我尝试使用各种git log选项来执行此操作,例如--no-merges选项,该选项似乎只忽略实际的合并提交。
I have also tried to simply find the files changed by each of us in the history using a command like so: 我还试图使用如下命令简单地找到我们每个人在历史记录中更改的文件:
git log --no-merges --author="Jeff" --name-only --pretty=format:"" <branch_point>..HEAD
However, as we have all done work which was in master at the time of merge, it is not clear what has been changed in which branch. 但是,由于我们都完成了合并时在母版中所做的工作,因此不清楚在哪个分支中进行了哪些更改。
Is there a nice, clean way to find out the files changed only in b1? 有没有一种很好的,干净的方法来找出仅在b1中更改过的文件? Any help would be much appreciated.
任何帮助将非常感激。
Assuming there are no conflicts, git diff master...b1
(ie triple dot). 假设没有冲突,
git diff master...b1
(即三点)。
That's not so well defined in a common case. 在通常情况下,定义不太好。 I guess one of the meaningful ways it to merge master into b1 again and then
diff
the merge result with the master. 我猜想它再次将master合并到b1,然后将合并结果与master进行
diff
的一种有意义的方式。 In this case it will show meaningful difference with all conflicts/inconsistencies solved by the merge. 在这种情况下,它将显示合并所解决的所有冲突/不一致的有意义的差异。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.