diff 和新的空文件
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.