dotfiles/script/gitsha1yank
2021-07-20 09:54:01 +02:00

13 lines
193 B
Bash
Executable File

#!/usr/bin/env bash
#
# Copy the last Git SHA1 to the clipboard
set -e
if [ "$1" = "-s" ]; then
args="--short"
fi
# TODO: fix for non-Darwin
git rev-parse $args HEAD | tr -d '\n' | pbcopy