Meaning of git log --oneline --graph output

后端 未结 2 1176
[愿得一人]
[愿得一人] 2021-02-09 10:44

I\'m learning about relative commit references and trying to understand the following git log --oneline --graph output provided in a lesson.

In the

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-09 11:07

    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.

    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.

提交回复
热议问题