patch的基本使用

diff -ruN old/  new/  > your_patch_file 生成new和old的patch

patch -p2 < your_patch_file  #跳过patch的filename的前2级,然后apply到当前目录

patch -RE -p2 your_patch_file  # revert刚才apply的patch,然后删除空文件

patch old_file your_patch_file # 给old_patch 打补丁

patch -R cur_file patch # 从当前文件revert掉patch

 

posted on 2021-12-18 12:02  疾速瓜牛  阅读(322)  评论(0编辑  收藏  举报

导航