Skip to content

Instantly share code, notes, and snippets.

@gandro
Last active November 24, 2023 15:44
Show Gist options
  • Save gandro/6c7b63c2c6dea64376ecbf437b73b8ee to your computer and use it in GitHub Desktop.
Save gandro/6c7b63c2c6dea64376ecbf437b73b8ee to your computer and use it in GitHub Desktop.
Extract the git tree hash for a given directory
#!/bin/sh
exec git -C "${1?"Usage: $0 <pathname> [commit]"}" rev-parse "${2:-HEAD}:./"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment