我有一些我不想引用的原始数据,但是我确实希望能够打补丁。如果我在文件中使用diff -u完全用其他内容替换了它的内容,而不是基本上得到全部删除和所有新行,而是在每行之前使用-得到了整个旧文件。
I have some original data that I do not want to reference, but I do want to be able to patch. If I use diff -u on a file where I entirely replaced its contents with something else, instead of getting basically a 'delete all' plus all the new lines, I get the whole old file with '-' before each line.
我们可以假设原始数据暂时没有变化。
We can assume the original data doesn't change for the moment. Is there a way to get diff to make a patch without duplicating any of the original data with '-' lines, i.e., have it just describe line numbers to delete along the way, and then all the insertions?
推荐答案对 diff $ c使用 -e 选项$ c>和补丁,而不是 -u 。
更多推荐
从差异输出中删除已删除的行
发布评论