I’m trying to apply a git patch created by someone else with git-format-patch. The patch was made against one commit behind HEAD, but as I understand it this shouldn’t matter. When I run git am 0001.patch, I get the error:
error: source.c: does not match index
I’m not too familiar with the format of git patches, but it does seem that the indexes don’t match, however the source does match.
What’s the best way to fix this? Manually change the indexes to match? Or should I git-apply and then copy the author and description information when I commit?
From J.C. Hamano (Git maintainer) himself, this is about:
With recent Git release, you can abort:
Then:
Note: one source of dirty tree can be the
autocrlfsetting (like in this msysgit issue 81), so make sure to set that to false.Other source of discrepancy:
core.whitespacesetting.The OP mentions in the comment:
Note: in the recent Git1.7.2 Release Notes: