I asked this question long ago but I still don't know what do ~ and ^ mean in this answer:
If you're talking about a remote branch, say, origin/master, you can use ~ and ^ to refer to ancestor commits relative to a branch the same way you can with local branches
What's the difference?
^
means "(first) parent of". ~
is similar, but it takes a number as an argument and basically means "ancestor of". So, for example:
HEAD = latest commit
HEAD^ = HEAD~1 = parent of latest commit
HEAD^^ = HEAD~2 = grandparent of latest commit
HEAD~100 = 100th ancestor of latest commit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With