Skip to content

Instantly share code, notes, and snippets.

View mschartman's full-sized avatar

Matt Schartman mschartman

  • SIMON Markets
  • New York
View GitHub Profile
function squash {
commits_to_squash="1"
commit_message="`git log -1 --pretty=%B`"
if [[ -n "$1" ]]
then
commits_to_squash=$1
fi
if [[ -n "$2" ]]

Keybase proof

I hereby claim:

  • I am mschartman on github.
  • I am mschartman (https://keybase.io/mschartman) on keybase.
  • I have a public key whose fingerprint is AAF1 BF49 2E7E CF7E DFAA F992 0AC8 64DA A582 E526

To claim this, I am signing this object:

@mschartman
mschartman / pre-commit
Created February 3, 2014 19:47
Pre-commit hook to warn you if you are committing directly to master.
if [ "$(git rev-parse --abbrev-ref HEAD)" == "master" ]
then
exec < /dev/tty
read -p "You are on the master branch, are you sure you want to commit? (y/N) " -n 1 -r
if [ "$REPLY" = "" ]; then
REPLY='N'
fi
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then