As long as we're just talking about whitespace: git apply
has the --ignore-whitespace
option:
When applying a patch, ignore changes in whitespace in context lines if necessary
This should help you. Reads like someone had the same issues like you before :-)
If it's not just a whitespace problem in context lines, I usually use git apply
with the --reject
option: hunks that could be applied will be applied, those with problems are stored in a .rej
file parallel to the patched file.