So I was trying to use apply a diff file to my git dev branch. The diff I wanted to apply was this one here: https://github.com/mbabker/joomla-cms/compare/JHtml_move.patch
I had the same issue, but I was testing a patch I was going to send to a listserve, following the recommendations here: https://www.kernel.org/doc/Documentation/email-clients.txt . I couldn't just fix the problem on my local file, I needed to distribute a patch which was potentially going to be mangled by gmail and I was checking the gmailed version with git apply
.
My co-worker pointed out to me that
git am
Is better than git apply
at correcting for these sorts of problems and is what should be used with .patch
files. This is mentioned in one of the comments above but it should be an answer.