git apply 打补丁

一:生成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

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值