If you've got a big project, running
before each commit can be fairly time consuming. Doing a git status and running phpcs on each modified file manually is just as fiddly.
#!/bin/bash files=$(git ls-files -om --exclude-standard) phpcs $files
Save it as an executable called git-cs in your PATH and typing the following will run phpcs on just the modified files...
Currently, there's no filtering of file types, but phpcs seems to do a pretty good job of ignoring files it can't sniff.