Skip to content

Instantly share code, notes, and snippets.

@smithjessk
Last active January 11, 2018 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smithjessk/056d06d3acb7d46db5220fc209565794 to your computer and use it in GitHub Desktop.
Save smithjessk/056d06d3acb7d46db5220fc209565794 to your computer and use it in GitHub Desktop.
Copy the hash of the Git commit you're on
#!/bin/bash
git show -q | head -n 1 | sed 's/commit //' | tr -d '\n' | xclip -i -selection clipboard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment