Skip to content

Instantly share code, notes, and snippets.

@cdallagnola
Created February 2, 2017 13:13
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 cdallagnola/8d195f59ed53b184e4253f293f429552 to your computer and use it in GitHub Desktop.
Save cdallagnola/8d195f59ed53b184e4253f293f429552 to your computer and use it in GitHub Desktop.
#!/bin/sh
i='System.out.println'
git diff |\
grep --color --with-filename -n $i \
&& echo '\nCOMMIT REJECTED Found "'$i'" in code !! Please remove them before commiting\n'\
&& exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment