尾随空格。补丁不适用

时间:2015-09-08 11:36:30

标签: git

我有3个文件a\test.txtb\test.txtc\test.txt

a\test.txt

x
y
z

b\test.txt

x
z
p
q

c\test.txt

x
y

现在我在a和b之间创建了一个补丁:

git diff --no-prefix --binary a b > mypatch.patch

导致此补丁:

diff --git a/test.txt b/test.txt
index 1b2c8f8..e0b3aec 100644
--- a/test.txt
+++ b/test.txt
@@ -1,3 +1,4 @@
 x
-y
-z
\ No newline at end of file
+z
+p
+q
\ No newline at end of file

接下来我想在c\test.txt上应用mypatch.patch:

cd c:\
git apply --ignore-space-change --ignore-whitespace ../mypatch.patch

我收到错误:

../mypatch.patch:10: trailing whitespace.
z
../mypatch.patch:11: trailing whitespace.
p
error: patch failed: test.txt:1
error: test.txt: patch does not apply

我已经在SO上阅读过一些帖子,但仍未设法将其应用于任何想法?

我在mypatch.patch中看不到任何尾随空格

0 个答案:

没有答案