diff --git a/git-hooks.md b/git-hooks.md index ea7fd36..62322b7 100644 --- a/git-hooks.md +++ b/git-hooks.md @@ -1,4 +1,12 @@ -Put the following in `.git/modules/public/hooks/pre-commit`: +Put the following in `.git/hooks/pre-commit`: + +```shell +#!/bin/sh + +for file in $(git status --porcelain --untracked=all | cut -b 4- | grep "\.png$") ; do pngcrush -brute -ow $file; done +``` + +And in `.git/modules/public/hooks/pre-commit`: ```shell #!/bin/sh