Git You have some suspicious patch lines
| Date: | Monday, December 29th, 2008 at 7:46 pm |
|---|---|
| url: | http://danklassen.com/wordpress/2008/12/git-you-have-some-suspicious-patch-lines/ |
So, I’ve run into this a few times now and it seems like bizarre behaviour to me. While committing, git complains about files which have trailing white space, or spaces followed by a tab. While this may not be the nicest formatting, enforcing this to be fixed before committing a file seems odd.
It turns out this is being caused by a pre-commit hook. There are two options you can go with to circumvent the issue:
git commit --no-verify .
The –no-verify will bypass the pre-commit hooks. This only works on the current commit thought, so you have to add the flag each time you want to commit.
I’ve found that if you:
cd .git/hooks/ chmod -x pre-commit
will disable the pre-commit hooks permanently by removing the executable rights on the file.
Apparently they are disabled by default in newer releases.
Hope this helps someone else out as well.
