git的大块编辑模式 - 如何删除“ - ”线?(git hunk edit mode - how

2019-07-29 12:39发布

+ 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

Answer 1:

make them ' ' lines意味着你需要更换-用在该行的前面 (空间)。



Answer 2:

一大块是这样的:

+ bbb <-- line added
- aaa <-- line deleted
  ccc <-- line unchanged

会变成这样的内容:

bbb
ccc

为了保持一条线标记为删除(前缀'-' ),把它变成具有相同前缀的线路unchanged上述行(所以它会保持不变):

+ bbb
  aaa
  ccc

当应用猛男,内容看起来是这样的:

bbb
aaa
ccc


文章来源: git hunk edit mode - how to remove a '-' line?
标签: git patch