到目前为止,我在Linux上使用以下命令创建了补丁:

diff -rupN oldDir newDir > fix.patch
并将其应用于此(来自oldDir):
patch -p1 < fix.patch
现在,我需要做一个别人创建的补丁,当我尝试这种方法时,我得到:
patch: **** Only garbage was found in the patch input.
我不确定如何生成此补丁(扩展名为.diff)。补丁文件的部分内容为:(只是更改了一些文件/文件夹名称)
Only in ../oldDir: someFile1.a
diff -r ../oldDir/someFolder1/SomeFile3 ./someFolder1/SomeFile3
10c10
< #someContent1
---
> #someContent1
Only in ../oldDir/someFolder1/someFolder2: someFile2.a
diff -r ../wfd_oldDir/someFolder1/someFolder2/someFile3 ./someFolder1/someFolder2/someFile3
2c2
< ##### Change the following for your environment:
---
> ##### Change the following for your environment:
15,16c15,16
< LIBRARY_LINK =        ar cr
< LIBRARY_LINK_OPTS =
---
> LIBRARY_LINK =        ar cr
> LIBRARY_LINK_OPTS =
36c36
<   $(C_COMPILER) -c $(C_FLAGS) $<
---
>   $(C_COMPILER) -c $(C_FLAGS) $<
.......(继续).......
如何应用此补丁?

最佳答案

检查Unix/Windows行尾

关于linux - 如何应用可能由diff -r命令创建的补丁?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11898324/

10-11 22:53
查看更多