Created
April 18, 2014 18:43
-
-
Save wasnotrice/11058583 to your computer and use it in GitHub Desktop.
Show the short SHA of the HEAD commit, and copy it to the clipboard (OS X)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # | |
| # Print the short version of a git revision and copy it | |
| # to the OS X clipboard | |
| REV=${1-HEAD} | |
| git rev-parse --short $REV -- | tee >(tr -d '\n' | pbcopy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment