Skip to content

Instantly share code, notes, and snippets.

View smclauch's full-sized avatar

Scott McLauchlan smclauch

View GitHub Profile
@smclauch
smclauch / pre-commit.sh
Created February 10, 2016 04:26
Git pre-commit script to check for AWS keys
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
EMPTY_TREE=$(git hash-object -t tree /dev/null)
against=$EMPTY_TREE
fi