Skip to content

Instantly share code, notes, and snippets.

@bastionkid
Created June 13, 2023 08:04
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 bastionkid/341c44d9f757168c3744920dd8a91693 to your computer and use it in GitHub Desktop.
Save bastionkid/341c44d9f757168c3744920dd8a91693 to your computer and use it in GitHub Desktop.
Shell script to generate short SHA from git head commit
#!/bin/bash
commit_id=$(git rev-parse HEAD)
echo "${commit_id:0:7}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment