A simple collection of scripts/sites I find useful day-to-day. Feel free to use or copy as you wish.
# Get the last commit SHA
git log -1 --format='%H' # long sha
git log -1 --format='%h' # short sha
Get the branch name only.
git rev-parse --abbrev-ref HEAD
OlderNewer