两个文件的情况:
制作补丁:
$ diff test1.c test2.c > test.patch
给test1.c打补丁:
$ patch test1.c < test.patch
还原:
$ patch -R test1.c < test.patch
两个文件夹的情况:
制作补丁:
$ diff -Nur dir1 dir2 > dir.patch
给文件夹dir1打补丁:
$ cd dir1
$ patch -p1 < ../dir.patch
还原:
$ patch -R -p1 < ../dir.patch
原文地址:https://www.cnblogs.com/dean757/p/12038460.html
时间: 2024-10-10 01:05:57