git 获取当前分支名,当前hash值

8,588 阅读1分钟

获取当前分支名:

$ git rev-parse --abbrev-ref HEAD

获取当前hash值

$ git rev-parse HEAD
# 获取短的
$ git rev-parse --short HEAD