我很乐意为您翻译中文,以下是您需要翻译的内容:
现在我已经创建了一个在a和b之间的补丁:
导致此补丁的产生:
我有三个文件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
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
我在SO上读了很多帖子,但仍然没有成功应用它的想法。有什么建议吗?
我在mypatch.patch中没有看到任何尾随空格。