我有一个我一直在处理的文件,然后意识到在我一直在工作的地方上面几行的地方我有一个错误。我很快修复了这个错误,并希望在我完成剩下的工作之前提交它。很好,这就是git add --patch的用武之地!
除了,我只看到了一个合并了这两个变化的大块头。有没有可能手动告诉git我想要两个大块头?
发布于 2009-07-13 21:36:00
除了“y”和“n”之外,当它问你关于一个大块头的问题时,你可以给出的一个答案是“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 and all the remaining hunks in the file
d - do not stage this hunk nor any of the remaining 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发布于 2009-07-14 06:57:30
git gui将允许您提交单个行,即使它们被您不想提交的其他修改过的行包围。
https://stackoverflow.com/questions/1122210
复制相似问题