Skip to content

Instantly share code, notes, and snippets.

@havenwood
Last active April 5, 2018 21:38
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 havenwood/38a9b504d815536a88a03ce794334102 to your computer and use it in GitHub Desktop.
Save havenwood/38a9b504d815536a88a03ce794334102 to your computer and use it in GitHub Desktop.
What is it git shasums?
message=$(git cat-file commit HEAD)
message_character_count=$(echo -n "$message" | wc -c | tr -d " ")
checksummed="commit $message_character_count\0$message"
echo -ne "$checksummed" | openssl sha1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment