Skip to content

Instantly share code, notes, and snippets.

View amdgigabyte's full-sized avatar
🤘
Working at Alibaba Growth Hacker Team

ZhangZipeng amdgigabyte

🤘
Working at Alibaba Growth Hacker Team
View GitHub Profile
@amdgigabyte
amdgigabyte / gist:69aada514f64a3d8aa06b2e23ce31521
Created April 28, 2016 02:28 — forked from guilherme/gist:9604324
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then