I'm trying to apply a patch to a file using git apply. The overall patch failed, so I used git apply --reject.
Inspecting the generated .rej file showed me what's wrong, now I fixed the problem in the .rej file.
But trying to apply the .rej file fails with message
fatal: patch fragment without header at line 2: ...
Is there a way to re-apply the .rej file after fixing the problems there?
Or do I have to modify the original patch and have to re-run git apply?
This would be a bit cumbersome in that case since the original patch contains patches for dozens of files and I don't want to git checkout the applied modifications in order to re-git apply the whole fixed patch file.
To clarify what @julian-squires said, the problem is that the
.rejfiles are missing some minor stuff betweendiff a/thefile...and@@ -line/columns....ORIGINAL
.rejfileYou need to copy the a/b filenames from the
diffline and add them with the change indicators below, like:UPDATED
.rejfileThen you can apply the
.rejfiles like a regular patch.