Skip to content

Instantly share code, notes, and snippets.

@jtrim
Created December 21, 2010 17:22
Show Gist options
  • Save jtrim/750240 to your computer and use it in GitHub Desktop.
Save jtrim/750240 to your computer and use it in GitHub Desktop.
Bash function to echo the latest git commit in oneline format and copy the SHA1 to your clipboard under OSX
function glast() {
LATEST=`git log --oneline -n 1`
echo -n $LATEST | ack '^([a-zA-Z0-9]*) {1}' --output='$1' | pbcopy
echo $LATEST
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment