Skip to content

Instantly share code, notes, and snippets.

@Bouke
Bouke / copy-last-commit-id-to-clipboard.sh
Created August 27, 2010 12:23
Copy commit-id to clipboard in post-commit hook
#!/bin/sh
# Use this per example as a post-commit hook
git log -n 1 --pretty=%H | tr -d '\n' | xclip -sel clip
echo "\033[32mCopied commit-id to clipboard\033[0m"