补丁命令和补丁文件

假设有hello1.c 和hello2.c 两个文件,这里假设,hello1.c 为低版本 文件,hello2.c 为高版本文件。可以使用“diff hello1.c hello2.c > test.patch”命令,生成补丁包“test.patch”。


补丁文件xxx.patch – "<"后面跟着要删除的内容 – ">"后面跟着要增加的内容

打补丁命令

– patch -p0 hello1.c < test.patch     (升级版本)

– 反向补丁patch -Rp0 hello1.c < test.patch     (降低版本)

发布了37 篇原创文章 · 获赞 0 · 访问量 2420

猜你喜欢

转载自blog.csdn.net/Linux_zhicheng/article/details/99348232
今日推荐