Imported on Feb 18, 2009
This is a recent problem I have come across with Git. Now I love using Git, but this put a damper on my workflow since the white space isn’t causing any problem, and aren’t even visible in my text editor. When you get the error, you may see something like this.
* * You have some suspicious patch lines: * * In mint/pepper/shauninman/iphone/class.php * trailing whitespace (line 125)
If you come across this problem, it will happen on a commit and won’t let you commit or push your project. You will have to edit .git/hooks/pre-commit Toward the bottom you will find this
if (/s$/) {
bad_line("trailing whitespace", $_);
}
if (/^s* t/) {
bad_line("indent SP followed by a TAB", $_);
}
Just comment those lines out like so.
# if (/s$/) {
# bad_line("trailing whitespace", $_);
# }
# if (/^s* t/) {
# bad_line("indent SP followed by a TAB", $_);
# }
After you do that, you should no longer have an issue. Just be sure to check your files locally to make sure everything is working alright.
originally posted on Stephen Korecky
Loading comments...