I have 3 files a\test.txt
, b\test.txt
and c\test.txt
:
a\test.txt
:
x
y
z
b\test.txt
:
x
z
p
q
c\test.txt
:
x
y
Now I created a patch between a and b:
git diff --no-prefix --binary a b > mypatch.patch
Resulting in this 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
Next I want to apply mypatch.patch on c\test.txt
:
cd c:\
git apply --ignore-space-change --ignore-whitespace ../mypatch.patch
I get the error:
../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
I have read a bunch of post here on SO but have still not managed to get it applied any ideas?
I don't see any trailing spaces in mypatch.patch