I'm using git with my team and would like to remove whitespace changes from my diffs, logs, merges, etc. I'm assuming that the easiest way to do this would be for git to automatically remove trailing whitespace (and other whitespace errors) from all commits as they are applied.
I have tried to add the following to by ~/.gitconfig
file but it doesn't do anything when I commit. Maybe it's designed for something different. What's the solution?
[core]
whitespace = trailing-space,space-before-tab
[apply]
whitespace = fix
I'm using ruby in case anyone has any ruby specific ideas. Automatic code formatting before committing would be the next step, but that's a hard problem and not really causing a big problem.