Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonatasnona/7605213 to your computer and use it in GitHub Desktop.
Save jonatasnona/7605213 to your computer and use it in GitHub Desktop.
#!/bin/sh
red="\033[1;31m"
color_end="\033[0m"
# Check unwanted trailing whitespace or space/tab indents;
if [[ `git diff --cached --check` ]]; then
echo -e ${red}Commit failed${color_end}
git diff --cached --check
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment