首页 > 其他 > 详细

打补丁说明

时间:2021-02-09 18:04:55      阅读:20      评论:0      收藏:0      [点我收藏+]

生成补丁文件:diff (常用选项) -Nuar “版本1” “版本2” >“补丁文件”
修复打补丁:patch -p(NUM) < 补丁文件
例如:
patch –R –p0 < to-file.patch #还原操作
-p:从补丁文件中找到的每个文件名中去掉包含num前导斜杠的最小前缀.(对比源文件路径)
参考链接:https://blog.csdn.net/zhongnanjun_3/article/details/7593904
########################################################################
进入到要打补丁的文件位置:
[root@ecs-12a3dd demo]# tree
.
├── s1
│   ├── find
│   └── test.sh
├── s2
│   ├── find
│   ├── test.sh
│   └── tmp.txt
└── source.patch

2 directories, 6 files
##########################################
[root@ecs-12a3dd demo]# diff -ur s1/ s2/
Binary files s1/find and s2/find differ
diff -u s1/test.sh s2/test.sh
--- s1/test.sh 2019-04-17 16:45:46.297000000 +0800
+++ s2/test.sh 2019-04-17 16:46:58.870000000 +0800
@@ -1 +1 @@
-hello world
+hello the world
Only in s2/: tmp.txt
###############################################

打补丁说明

原文:https://www.cnblogs.com/Haihong72H/p/14392813.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!