β»οΈ Goal
git add
μ΅μ μ¬λ¬κ°μ§ μ΄ν΄λ³΄κΈ°- μ΅μ μ ν΅ν΄ add νλ €λ κ° νμΌμ λ³κ²½μ¬νμ νμΈν λ€ μ€ν μ΄μ§ ν μ§ κ²°μ ν μ μλ€.
Stage this hunk [y,n,q,a,d,s,e,?]
λͺ λ Ήμ΄λ₯Ό μ¬μ©ν μ μλ€.- μ΄ μ€ μμ£Ό μ¬μ©λλ
y
,n
,q
λͺ λ Ήμ΄λ§ μκ³ μμ΄λ μΆ©λΆνλ€.
β»οΈ git add -p
git add -p
λ₯Ό μ¬μ©νκ² λλ©΄, νμ¬ λ³κ²½λ μ½λλ€μ νμΌλ€μ νλμ© λ³΄μ¬μ£Όκ³ ν΄λΉ νμΌμ μ€ν
μ΄μ§μ μ¬λ¦΄ κ²μΈμ§, μ¬λ¦¬μ§ μμ κ²μΈμ§ λ°λ‘ μ νν μ μλ€.
1
2
3
> git status (λ³κ²½λ νμΌ μν보기)
> git diff (μ€ν
μ΄μ§μ μ¬λΌκ°μ§ μμ νμΌλ€μ λ³κ²½μ¬ν 보기)
> git add (μ€ν
μ΄μ§ νκΈ°) or git checkout --νμΌλͺ
μμ μΈ κ°μ§ κ³Όμ μ git add -p
λ‘ ν λ²μ μ§νν μ μκ² λλ€.
β»οΈ hunk λͺ λ Ήμ΄ λͺ¨μ
hunk
: μ€ν μ΄μ§μ μ¬λΌκ° μ μλ νλμ λ¨μ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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