git log --oneline --graph输出的含义 [英] Meaning of git log --oneline --graph output
问题描述
我正在学习相对的提交引用,并试图理解本课中提供的以下git log --oneline --graph
输出.
I'm learning about relative commit references and trying to understand the following git log --oneline --graph
output provided in a lesson.
在本课中,它说给定HEAD指向9ec05ca
提交,HEAD ^^^(意思是曾祖父母提交)是0c5975a
提交.但是在我看来4c9749e
应该是曾祖父母,如果每个SHA都是其下一个的直接后代.任何澄清表示赞赏.
In the lesson it says that given HEAD points to the 9ec05ca
commit, HEAD^^^ (meaning the great-grandparent commit) is the 0c5975a
commit. But it seems to me 4c9749e
should be the great grandparent, if each SHA is a direct descendant of the one below it. Any clarification appreciated.
推荐答案
提交可以有多个父级. ^ 1表示第一个父母. ^ 2表示第二个父级,然后继续.只是^默认为第一个父级^ 1.
Commit can have more than one parent. ^ 1 means first parent. ^2 means second parent and do on. Just ^ defaults to ^1 which is first parent.
同样,〜可以访问祖先.例如,如果您想要3代〜3.如果要在遍历时偏爱第一父级的同一分支中的第七次提交.
Similarly ~ give access to traverse up for an ancestor. For example if you want 3 generation up ~3. If you want 7th last commit in same branch favouring first parent while traversing.
任何合并将有两个父级,并且合并到分支成为第一个父级.从分支合并成为第二个父级.
Any merge will have two parents with merge to branch becoming first parent. Merge from branch becoming second parent.
这篇关于git log --oneline --graph输出的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!