4
我有3個文件a\test.txt
,b\test.txt
和c\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
我已經閱讀了一堆這裏的帖子,但仍然沒有設法讓它應用任何想法?
我沒有看到任何尾隨空格在mypatch.patch