What's the difference between HEAD^ and HEAD~ in Git? - Stack Overflow
HEAD^ means the first parent of the tip of the current branch.
Remember that git commits can have more than one parent. HEAD^ is short for HEAD^1, and you can also address HEAD^2 and so on as appropriate.
You can get to parents of any commit, not just HEAD. You can also move back through generations: for example, master~2 means the grandparent of the tip of the master branch, favoring the first parent in cases of ambiguity. These specifiers can be chained arbitrarily , e.g., topic~3^2.
Read full article from What's the difference between HEAD^ and HEAD~ in Git? - Stack Overflow
No comments:
Post a Comment