I found a lot of ways to deal with the whitespace problem in Git, but all of them require some sort of action on the user side: configure Git to ignore ws changes, setup a pre-commit hook with warning, or just configure the editor to remove them automatically. But is there a way to simply ignore whitespace changes on the server side or even better to strip all whitespace silently?Background: we have a large repository with a number of developers whom we do not want to chase and convince to reconfigure their tools, but we do not want to have any trailing whitespace in our repository. For me the solution is obvious: strip all whitespace once, and ignore any ws changes from that point on. Ideally, also strip ws in all new commits. But how can I do this?
Git Server: ignore whitespace changes in new commits
configuration;git;whitespace
You can't really do this sanely.  You can't modify the content of a commit; you can only create new commits.  Even if this were possible, it would break git: the commits on the server would be unrelated to the history stored in local developer repositories, and nothing would ever work.  You really need to perform this sort of filtering before files are added to the repository, which is why you do it client side in pre-commit hooks, etc.A better solution is to implement an enforcement mechanism on the server: reject changes that don't meet your standards.