如何从基本文件和diff文件中获取修改后的文件?

时间:2009-08-30 20:13:47

标签: merge diff base

考虑以下示例:

$ls
base.txt base-modified.txt
$diff base.txt base-modified.txt > diff.txt
$rm base-modified.txt
$

我想要base.txt和diff.txt中的base-modified.txt ... 任何人都可以建议吗?

1 个答案:

答案 0 :(得分:2)

您可以使用patch

cp base.txt base-modified.txt
patch base-modified.txt diff.txt