gpt4 book ai didi

linux - 如何应用可能用 diff -r 命令创建的补丁?

转载 作者:太空狗 更新时间:2023-10-29 12:20:13 26 4
gpt4 key购买 nike

到目前为止,我在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com