Cherry-pick with ignore whitespace / line-endings

hwjp picture hwjp · Jul 16, 2014 · Viewed 8.5k times · Source

is there a way to tell git cherry-pick to use the renormalize merge strategy? I'm not sure the -X option is working.

I have a bunch of commits that seem to assume one type of line ending, and I'm trying to apply them to a branch that assumes another. Not having a good time...

Answer

hwjp picture hwjp · Nov 20, 2014

So, for completeness, the answer is that the ignore-all-space merge strategy does the job:

git cherry-pick -X ignore-all-space <commit-id>

And that will let you painlessly cherry-pick commits made when the file had, eg, windows line endings onto a version that has unix file endings.