精彩文章免费看

git获取commit id

  • 获取完整commit id(如:5fbfac84b4e442b7b09221ec6e27b00dd83e18c6)
    git rev-parse HEAD
  • 获取short commit id(如:5fbfac8)
    git rev-parse --short HEAD