Skip to content

Instantly share code, notes, and snippets.

@isaiahtaylor
Last active July 8, 2021 18:51
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 isaiahtaylor/e1b4e2df218b6656801f7be5c52823ab to your computer and use it in GitHub Desktop.
Save isaiahtaylor/e1b4e2df218b6656801f7be5c52823ab to your computer and use it in GitHub Desktop.
Hash a directory while respecting .gitignore
git ls-files --exclude-standard -os $SRC | git hash-object --stdin
# Outputs: 6c385b1a8e5438bb756bac652d0cd6be9d555dbe (or similar)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment