Get the commit hash for a tag

后端 未结 5 1240
感动是毒
感动是毒 2021-01-01 18:05

It is related to Making git show to show information in a machine parseable format but I am getting tired of the fact that I now have to do a lot of parsing to get the commi

5条回答
  •  执念已碎
    2021-01-01 18:41

    git log  -1 --pretty=%H
    

    -1: tells it to only print 1 commit

    --pretty=%H: tells it to only print the full hash

提交回复
热议问题