git - show the latest commit hash

December 12, 2024



I guess, there are more ways to accomplish this:

git log --format="%H" | head -n 1
  %H: commit hash
  %h: abbreviated commit hash