2011-08-05 52 views

回答

85

您可以使用git checkout -p單獨查看每個大塊,並決定是檢查它們還是將它們保持原樣(並且如果您想進一步縮小範圍,也需要可選的路徑參數)。

24

爲了詳細說明馬特的回答,git checkout --patch -- <path argument>啓動交互模式有以下選項:

y - stage this hunk 
n - do not stage this hunk 

q - quit; do not stage this hunk or any of the remaining ones 
a - stage this hunk and all later hunks in the file 
d - do not stage this hunk or 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 

ynse選項是一個良好的開端。

參見:

相關問題