Short git version hash

Snippet

Use rev-parse for the git hash, and the --short option for the short version of the hash.

# view the git hash of the last commit
$ git rev-parse HEAD 
1f0543ff172bdc5c5e90aac41c84103049f58390
 
# view the short git hash of the last commit 
$ git rev-parse --short HEAD
1f0543f

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.