( gthomas | 2013. 03. 26., k – 14:29 )

.git/hooks/pre-commit.sample -t nézd meg.

Konkrétan az utolsó két sora:

# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --

Tehát ha ezt a három sort beteszed a .git/hooks/pre-commit fájlba, és futtatható, akkor elvileg azt teszi, amit akartál:

#!/bin/sh
# If there are whitespace errors, print the offending file names and fail.
exec git diff-index --check --cached $against --