Skip to content

Instantly share code, notes, and snippets.

@sungmin-park
Created January 7, 2026 13:38
Show Gist options
  • Select an option

  • Save sungmin-park/675ff077ebf5cd9f4897b480579dc537 to your computer and use it in GitHub Desktop.

Select an option

Save sungmin-park/675ff077ebf5cd9f4897b480579dc537 to your computer and use it in GitHub Desktop.
git-revision.sh
#!/bin/sh
set -euo pipefail
test -z "$(git status --porcelain)" && echo "$(git rev-parse HEAD)" || echo "$(git rev-parse HEAD)-dirty"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment