尝试使用 git add -p
和 split
选项将一个巨大的块分成更小的块,但整个文件看起来像一个块,我无法将其拆分。
- 我可以进行编辑,但删除行会导致补丁失败。
git help add
告诉我应该已经分割过了,并且我记得我使用过它,但在当前示例中,该选项未出现在提示中。- 当我选择该选项时,会打印帮助信息,其中提到我可以选择 s 来拆分 :-[。
Git 版本:1.9.1。Xubuntu 14,oh-my-zsh。这个块不是一行,而是多行。有没有想法为什么会这样?
附带更多数据进行编辑,以下是控制台日志:
+last line of long text
Stage this hunk [y,n,q,a,d,/,e,?]? s
y - stage this hunk
n - do not stage this hunk
q - quit; do not stage this hunk nor any of the remaining ones
a - stage this hunk and all later hunks in the file
d - do not stage this hunk nor any of the later hunks in the file
g - select a hunk to go to
/ - search for a hunk matching the given regex
j - leave this hunk undecided, see next undecided hunk
J - leave this hunk undecided, see next hunk
k - leave this hunk undecided, see previous undecided hunk
K - leave this hunk undecided, see previous hunk
s - split the current hunk into smaller hunks
e - manually edit the current hunk
? - print help
-i
)才能使用 split。 - Lee Duhem