git diff仅显示提交修订/分支A在修订/分支B之前 [英] git diff showing only commits that revision/branch A is ahead of revision/branch B
问题描述
有时我遇到以下问题:
-
在功能分支中添加一些提交。
-
从上游更新主设备。
-
想要查看功能分支和主设备之间的差异,但
git diff master
显示在master中添加/删除的所有东西,当我真的只想看到功能分支在主控之前的提交,而不是那些它是 Add some commits in a feature branch.
Update master from upstream.
Want to see the diff between the feature branch and master, but
git diff master
shows all of the things that have been added/removed in master, when I really only want to see the commits that the feature branch is ahead of master, not the ones that it's behind.
有没有办法做到这一点,而不必将主人合并到功能分支?
我认为正确的答案是三重点
git diff master ...特性
。另请参阅: git diff - 仅显示新增内容远程
Sometimes I have the following problem:
Is there a way to do this without having to merge master into the feature branch?
I think the right answer is triple dot
git diff master...feature
That shows only new changes on feature with respect to master. See also: git diff - show only what's new on the remote
这篇关于git diff仅显示提交修订/分支A在修订/分支B之前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!