dotfiles/script/gitsha1yank

13 lines
195 B
Plaintext
Raw Permalink Normal View History

2021-06-18 13:13:57 +00:00
#!/usr/bin/env bash
#
# Copy the last Git SHA1 to the clipboard
set -e
if [ "$1" = "-s" ]; then
2021-06-18 13:13:57 +00:00
args="--short"
fi
# TODO: fix for non-Darwin
2023-10-07 08:43:32 +00:00
git rev-parse "$args" HEAD | tr -d '\n' | pbcopy