假设有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 (降低版本)