Skip to content

Instantly share code, notes, and snippets.

@sumanstats
Last active October 23, 2021 11:28
Show Gist options
  • Save sumanstats/73287a9dff1e3fade006039339c0df51 to your computer and use it in GitHub Desktop.
Save sumanstats/73287a9dff1e3fade006039339c0df51 to your computer and use it in GitHub Desktop.
# Get the first 6 digits of the hash of last commit
# In bash
git ls-remote git://github.com/rakudo/rakudo.git refs/heads/master | cut -f 1 | cut -c1-6
# In powershell
(git ls-remote git://github.com/rakudo/rakudo.git refs/heads/master).Split()[0].SubString(0,6)
# Within repo
# bash
git log -n 1 --pretty=format:"%H" | cut -c1-6
# powershell
(git log -n 1 --pretty=format:"%H").SubString(0,6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment