1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00
Files
til/git/get-the-short-version-of-the-latest-commit.md

429 B

Get The Short Version Of The Latest Commit

As part of some automated scripting for an app deployment I wanted to be able to get the short version of the latest commit to the current git repo. Git's rev-parse command is the perfect fit for this.

$ git rev-parse --short HEAD
708248b

See man git-rev-parse for more details.

source