从差异输出中删除已删除的行

编程入门 行业动态 更新时间:2024-10-26 04:25:19
本文介绍了从差异输出中删除已删除的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一些我不想引用的原始数据,但是我确实希望能够打补丁。如果我在文件中使用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 和补丁,而不是 -u 。

更多推荐

从差异输出中删除已删除的行

本文发布于:2023-10-24 09:48:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1523618.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:差异

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!