【发布时间】:2014-04-07 12:22:34
【问题描述】:
这是diff -u "temp temp/docs 1.txt" "temp temp/docs 2.txt"的输出:
--- temp temp/docs 1.txt Mon Apr 7 16:15:08 2014
+++ temp temp/docs 2.txt Mon Apr 7 16:18:45 2014
@@ -2,6 +2,6 @@
22
333
4444
-555555
+55555
666666
7777777
但是,将此差异提供给 patch -u 失败并显示以下消息:
can't find file to patch at input line 3
Perhaps you should have used the -p or --strip option?
The text leading up to this was:
--------------------------
|--- temp temp/docs 1.txt Mon Apr 7 16:15:08 2014
|+++ temp temp/docs 2.txt Mon Apr 7 16:18:45 2014
--------------------------
显然,空格是问题所在;有没有办法让patch 处理名称中有空格的文件?
【问题讨论】:
-
附带说明,如果您使用 git,为什么不使用
git diff和git apply? -
@Cupcake 因为我没有使用 git?.. 我刚刚安装了带有
diff和patch的 Cygwin。 -
您的问题被标记为git :P 我会修复它...