Both ^
and ~
themselves mean the parent.
~
followed by a number works the same as putting the same number of ~
. For example, my_commit~3
is the same as my_commit~~~
which refers to the 3rd parent of my_commit
.
But ^2
only makes sense for a merge commit, i.e., merge_commit^2
means the second parent of the merge_commit
, merge_commit^1
is the same as merge_commit^
or merge_commit~
or merge_commit~1
.
On the other hand, repetitive ^
is the same as repetitive ~
. For example, ~~~
is the same as ^^^
, and the same as ~3
.
Some examples: