What's the difference between HEAD^ and HEAD~ in Git?

前端 未结 16 2192
醉酒成梦
醉酒成梦 2020-11-22 10:43

When I specify an ancestor commit object in Git, I\'m confused between HEAD^ and HEAD~.

Both have a \"numbered\" version like HEAD^3<

16条回答
  •  时光说笑
    2020-11-22 11:19

    HEAD^^^ is the same as HEAD~3, selecting the third commit before HEAD

    HEAD^2 specifies the second head in a merge commit

提交回复
热议问题