Last active
July 23, 2024 19:41
-
-
Save mamchenkov/930900 to your computer and use it in GitHub Desktop.
Find current git commit id/hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git log -1 | grep ^commit | cut -d " " -f 2 | |
dab96492ac7d906368ac9c7a17cb0dbd670923d9 | |
$ git log -1 | grep ^commit | awk '{print $2}' | |
dab96492ac7d906368ac9c7a17cb0dbd670923d9 |
git rev-parse HEAD
git rev-parse --short=11 HEAD
where 11
is a number of symbols from hash to show
it helps a lot, thank you all
git log --branches -1 --pretty=format:"%H"
Thanks. It helps!
git rev-parse HEAD
Good
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ git log -1 --pretty=format:"%H"
Works well too.