考虑以下情况:
多个分支 - master,dev1..dev-n和feature1。在feature1分支上发生了一些开发(对该分支进行了提交),我需要对它们进行审核。
...然而
所以图表看起来像这样:
M F
|
g (merge F to master)
|\
| \
f |
| 4 (last commit to F)
e |
| 3 (merge master to F - F contains commit b,c)
d/|
| 2
c |
| 1 (first commit to F)
b /
|/
a(base)
如何直接看到分支F(1-4)的提交,而不会看到对其他分支的提交并合并到F(a-g)中?
答案 0 :(得分:1)
你可以试试这个:git log d..4
表示4
(a b c d 1 2 3 4)但d
(a b c d)中的所有提交,结果为1 2 3 4
有关Revision Selection
的更多信息,请访问Revision Selection
答案 1 :(得分:1)
以下是使用reflog的自定义解决方案:
git log --first-parent --no-merges $(git reflog feature1|tail -1|cut -d' ' -f1)..feature1
reflog给出了该分支引用的所有更新,而tail只获得了第一个(即fork point),然后我们只剪切了fork的SHA。