Referring to the previous/next commit in git?

前端 未结 3 1149
野的像风
野的像风 2021-01-01 11:31

I have seen git commands use a syntax such as HEAD~, but I haven\'t been able to find this syntax in the Git Reference Manual.

Here is what I have under

3条回答
  •  孤独总比滥情好
    2021-01-01 12:08

    Inspired by @cexbrayat's answer, I find it useful to think of it this way:

    How to refer to something in a commit's ancestry, where a commit can have multiple parents:

    • ^n specifies which parent

    • ~n specifies which generation

    Both default to one.

提交回复
热议问题