Tuesday, June 22, 2010

Git: You have some suspicious patch lines…

Monday, December 29th, 2008 at 7:46 pm

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.

No comments:

Post a Comment