Skip to content

^ vs ~ in git HEAD #22165

Discussion options

You must be logged in to vote

The reference for commit expression operators such as ^ and ~ is the “Specifying Revisions” section of the git rev-parse man page. In general, commit^N means the Nth parent of commit, while commit~N means the commit reached by following the first parent N times. When N = 1, these are coincidentally the same. But when N is not 1, they are different: for example, commit^2 is the second parent of commit, while commit~2 is the first parent of the first parent of commit.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants