Git error: “fatal: corrupt patch at line 36”

This is happens when you edit ‘-‘ lines.
When you remove ‘-‘ and forget to add ‘ ‘ (space) instead of it

Open your patch and check that all lines you want to leave untouched are started with ‘ ‘ (space)

UPDATE

It is also possible that your editor has the option: “Delete spaces at the end of line”. So, when you save the patch in your editor:

-Line with space at end <--- NOTICE: Here there is one space at the end
+Line with no space at end<--- Here there's no space

Your editor will remove trailing space and patch become like this:

-Line with space at end<--- Here no space. Patch will FAIL!!!
+Line with no space at end<--- Here no space also

This patch will FAIL because the origin file has no line:

-Line with space at end<---

instead it has:

-Line with space at end <--- 

UPD
Sometimes you want to remove - lines. You change it by whitespace which is trimmed. So this does not work (here is just wihitespace as first character):

 

To workaround this just add + line after it:

-
+

This patch will remove empty line and add it again

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)