Skip to content

Instantly share code, notes, and snippets.

@Bouke
Created August 27, 2010 12:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bouke/553258 to your computer and use it in GitHub Desktop.
Save Bouke/553258 to your computer and use it in GitHub Desktop.
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment