Created
May 4, 2020 15:15
-
-
Save m-makuch/a5039f26fd65e00bf12f5b5b7083ca02 to your computer and use it in GitHub Desktop.
Extract first 7 characters of git commit hash
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 | |
| set -e | |
| HEAD_HASH=$(git rev-parse HEAD) | |
| HEAD_HASH=${HEAD_HASH:0:7} | |
| echo $HEAD_HASH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment