Git command to display HEAD commit id?

前端 未结 9 1726
轮回少年
轮回少年 2020-12-22 15:27

What command can I use to print out the commit id of HEAD?

This is what I\'m doing by hand:

$ cat .git/HEAD
ref: refs/heads/v3.3
$ cat .git/refs/head         


        
9条回答
  •  借酒劲吻你
    2020-12-22 15:49

    You can use this command

    $ git rev-list HEAD

    You can also use the head Unix command to show the latest n HEAD commits like

    $ git rev-list HEAD | head - 2

提交回复
热议问题