Git -p bağlamında [y, n, q, a, d, /, K, j, J, g, e,] ne anlama gelir?


272

-P modunu kullanırken git add -pveya git stash -pharflerin her biri ne anlama gelir?

Sanırım yevet ve nhayır. Gerisi nedir?

[Y, n, q, A, D, / K, J, J, g, e ,?]


64
?Seçeneği denerseniz, öğreneceksiniz
Abe Voelker

7
Belki biraz yukarı kaydırmak zorundasın?
Cosimo

1
Kabul edilen cevaptaki çıktıda '?' Girilirken listelenmeyen seçenekler var
Mark

Yanıtlar:


325

-pMod araçları yama, yardım bulmak zor-ish ama eğer kontrol git add --helpaşağıdakileri bulacaksınız

   patch
       This lets you choose one path out of a status like selection. After choosing the path, it presents the diff between the index and the working tree file and asks you if you want to stage the change of each hunk. You can select one of the following options and type return:

           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

8
@VicGoldfeld d sonraki dosyaya ilerlerken q işlemi tamamen iptal eder mi?
Steve

5
qyok değil daha önce sahnelenen değişiklikleri sıfırlayın. Önceden sahnelediğiniz her şey sahnelendi.
Alexander Bird

Ben -psaklamak için kullanıyorum, bunu da kullanabileceğinizi bilmiyordum add! Sadece bu cevaba eklemek için, -p | --patchbayraktan bahsedilirken , bu cmd: git stash --helpyama seçenekleri hakkında size aynı bilgileri VERMEZ git add --help.
Phil Gibbins

31

Bu harflerin anlamı yazarak bulunabilir mi? ve Enter tuşuna basın. Benim için bunlar kaçarken gelmedi git add --help. Bu seçeneklerin anlamını aşağıdaki gibi aldım: -

Arup-iMac:$ git add -p
diff --git a/app/interactors/reporting_groups/list_colleagues.rb b/app/interactors/reporting_groups/list_colleagues.rb
index adc28af..f46f5e3 100644
--- a/app/interactors/reporting_groups/list_colleagues.rb
+++ b/app/interactors/reporting_groups/list_colleagues.rb
@@ -14,7 +14,4 @@ module ReportingGroups
         reporting_group.employees_from_team_sub_reporting_groups
       else
         reporting_group.users
-      end
-    end
-  end
-end
+      
Stage this hunk [y,n,q,a,d,/,e,?]? ? <-- Look here, what I typed to get these.
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
@@ -14,7 +14,4 @@ module ReportingGroups
         reporting_group.employees_from_team_sub_reporting_groups
       else
         reporting_group.users
-      end
-    end
-  end
-end
+      
Stage this hunk [y,n,q,a,d,/,e,?]? 
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.