+ bbb
- aaa
# ---
# To remove '-' lines, make them ' ' lines (context).
# To remove '+' lines, delete them.
# Lines starting with # will be removed.
#
# If the patch applies cleanly, the edited hunk will immediately be
# marked for staging. If it does not apply cleanly, you will be given
# an opportunity to edit again. If all lines of the hunk are removed,
# then the edit is aborted and the hunk is left unchanged.
我根本不明白make them ' ' lines
的含义。如何仅应用+ bbb
而不是- aaa
?
答案 0 :(得分:75)
make them ' ' lines
表示您需要使用-
(空格)替换该行前面的。
答案 1 :(得分:11)
像这样的大块头:
+ bbb <-- line added
- aaa <-- line deleted
ccc <-- line unchanged
会变成这样的内容:
bbb
ccc
要保留标记为删除的行(前缀为'-'
),请将其转换为与上面的unchanged
行具有相同前缀的行(因此它将保持不变):
+ bbb
aaa
ccc
应用大块时,内容将如下所示:
bbb
aaa
ccc