一:生成patch 和打patch
有这样的 目录层次 x/xx/xxx/xxx/test.c
我的当前位置是在 x/ 下 ,执行 git diff> test.patch
在test.patch补丁文件里的路径信息是这样的:
- - - a/xx/xxx/xxx
+++b/xx/xxx/xxx
如果 应用 test.patch 的时候的 位置 是在 x/ 下,
执行:
patch -p1 < test.patch
--------------------------------------
git diff> test.patch,这是产生patch的方式。
注意,使用gitdiff产生的patch都应该在执行 patch 命令时, 指定-p1,当 位置是 【在哪里制作的patch,就在哪里 执行】
二:
$git apply 0006-Philips-VSO-library-Report-only-the-actual-data-to-a.patch
error: patch failed: sensors-see/sensors-hal/sensors/philips_rr.cpp:81
error: sensors-see/sensors-hal/sensors/philips_rr.cpp: patch does not apply
error: patch failed: sensors-see/sensors-hal/sensors/philips_spo2.cpp:81
error: sensors-see/sensors-hal/sensors/philips_spo2.cpp: patch does not appl

最低0.47元/天 解锁文章
1059

被折叠的 条评论
为什么被折叠?



