linux 生成补丁以及给文件打补丁

生成补丁文件(建议在同一目录中操作)
1
diff -Naur old.txt new.txt > test.patch

old.txt 旧的文件

new.txt 新的文件

test.patch 生成的补丁文件

生成的补丁文件如下

1
2
3
4
5
6
7
8
9
10
--- coredns.yaml	2020-08-22 16:39:34.555058930 +0800
+++ 1.yaml 2020-08-22 16:39:34.555058950 +0800 # 这行实际上没用,可以删除
@@ -81,6 +81,7 @@
# replicas: not specified here:
# 1. Default is 1.
# 2. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
+ replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
给旧文件打补丁
1
patch -p0 < test.patch
打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2018-2024 Outsrkem
  • 访问人数: | 浏览次数:

      请我喝杯咖啡吧~

      支付宝
      微信