Symbols such as ^
and ~
could be used for relative positioning for #202204261252. It could be applied to HEAD itself, branch name or tag, but not to individual commit.
^
means moving up to one commit or its nearest parent from the current commit. If followed by number, let’s say \(x\), it will point to the \(x\)th parent of the commit in the Git DAG. You can visualise it in git log --graph
. This could be useful when dealing with repository that use #202204261123 often.
~{#}
means moving up along the commit in a linear sense. This means that it will always prioritise the nearest parent of the commit. If number is not specified, it behaves the same with ^
. Otherwise, it will move up \(x\)-th times linearly along the commit history.