When I specify an ancestor commit object in Git, I\'m confused between HEAD^ and HEAD~.
Both have a \"numbered\" version like HEAD^3<
Here's a very good explanation taken verbatim from http://www.paulboxley.com/blog/2011/06/git-caret-and-tilde :
ref~is shorthand forref~1and means the commit's first parent.ref~2means the commit's first parent's first parent.ref~3means the commit's first parent's first parent's first parent. And so on.
ref^is shorthand forref^1and means the commit's first parent. But where the two differ is thatref^2means the commit's second parent (remember, commits can have two parents when they are a merge).The
^and~operators can be combined.