如何在 Git 中找到下一个提交?(参考的孩子/孩子) [英] How do I find the next commit in Git? (child/children of ref)
本文介绍了如何在 Git 中找到下一个提交?(参考的孩子/孩子)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
ref^
指的是 ref
之前的提交.在 ref
之后获得提交怎么样?
ref^
refers to the commit before ref
. What about getting the commit after ref
?
例如,如果我git checkout 12345
,我如何检查下一次提交?
For example, if I git checkout 12345
, how do I check out the next commit?
PS:是的,Git 是一个 DAG 节点指针结构树.我如何找到这个提交之后的提交?
PS: Yes, Git's a DAG node pointer struct tree whatever. How do I find the commit after this one?
推荐答案
列出所有提交,从当前提交开始,然后是它的子提交,等等 - 基本上是标准的 git log,但在时间上相反,使用类似
To list all the commits, starting from the current one, and then its child, and so on - basically standard git log, but going the other way in time, use something like
git log --reverse --ancestry-path 894e8b4e93d8f3^..master
其中 894e8b4e93d8f3 是您要显示的第一个提交.
where 894e8b4e93d8f3 is the first commit you want to show.
这篇关于如何在 Git 中找到下一个提交?(参考的孩子/孩子)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文