Git错误:“致命:第36行的损坏补丁” [英] Git error: "fatal: corrupt patch at line 36"
问题描述
}
}
我前段时间错误地删除了换行符,但直到今天,当我收到来自Git的错误消息-GUI提交时
致命:第36行的损坏补丁
我尝试添加缺失的换行符,但Git似乎无法正确处理它:
在添加换行符:
}
}
\在文件结尾没有换行符
code>
添加换行符后:
}
- }
\在文件结尾没有新行
+}
它仍然给我那个错误。
我试着恢复更改并只添加换行符而没有对文件进行其他更改,但它没有帮助
编辑:添加两个甚至三个换行符
$ b EDIT2:这个错误仅在最后一个大块内提交时才会出现。
好的,不要彻底检查它。
我尝试添加和提交,没有Git-GUI,使用命令行,它工作。
所以,我建议每个有Git-GUI问题的人都不要像我那样做并在发布之前通过命令行进行检查。
I have a Java file that ends like this:
}
}
And I mistakenly erased the newline at the end some time ago, but it was fine just until today when I got an error message from Git-GUI when commiting
fatal: corrupt patch at line 36
I tried adding the missing newline, but Git seems not to be able to handle it right:
Before adding newline:
}
}
\ No newline at end of file
After adding newline:
}
-}
\ No newline at end of file
+}
And it still gives me that error.
I tried reverting changes and adding only the newline without other changes to the file, but it didn't help either.
EDIT: Adding two or even three newlines doesn't help too.
EDIT2: This error occurs only when commiting lines within the last hunk.
Ok, sorry for not checking it thoroughly.
I tried adding and commiting as I would normally do, but without Git-GUI, using command-line, and it worked.
And so, I'd recommend everyone that has problems with Git-GUI not to do like I did and check it through command-line before posting.
这篇关于Git错误:“致命:第36行的损坏补丁”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!