diff 和新的空文件

发布于 2024-08-05 18:20:05 字数 321 浏览 2 评论 0原文

我正在使用 diff -Naur 向客户发送单个补丁,以便更新他们的存储库快照。

我尝试使用 git diff -p 来获取单个文件补丁,但显然它不包含补丁中的新二进制文件

我知道我应该使用 git-format-patch,但它创建的补丁只能在 git 内部使用而且我没有故意将 .git 目录提供给我们的客户。

我求助于使用 差异-瑙尔 这确实会将快照更改为新快照,但有一点是:如果要创建新文件,并且它们是空的,则它们不在修补的快照中。

在告诉我的客户做之前 xargs 触摸 <空文件列表.txt 我想我应该在这里问...

TIA

I'm using diff -Naur to send a single patch to a customer, in order to update their snapshot of our repository.

I tried using git diff -p to get a single file patch, but apparently it doesn't include new binary files in the patch

I know I should have used git-format-patch, but it creates patches which can be only used inside git and I haven't given the .git directory to our customer on purpose.

I resorted to using
diff -Naur
which does change the snapshot to the new one, but for one thing: if there are new files to be created, and they are empty, then they are not in the patched snapshot.

Before telling my customer to do a
xargs touch < empty_file_list.txt
I thought I'd ask here...

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挖鼻大婶 2024-08-12 18:20:05

diff 纯粹用于文本文件。 diff -b 会告诉您二进制文件是否不同,但不会为它们生成差异。您的选择是向客户发送包含二进制文件和文本文件差异的 tar 或 zip 文件,或者查看二进制差异/补丁实用程序,例如 bsdiff.

diff is purely for text files. diff -b will tell you whether binary files differ but it won't generate a diff for them. Your options would either be to send a tar or zip file to your customer containing the binary files and a diff for the text files or to look into binary diff/patch utilities such as bsdiff.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文