ใใฃใใ็งๅฟๆ
ๅ ฑใใใใทใฅใใ็ต้จใฏใใใพใใใ๏ผ
ใใใชๆฒๅใๅ้ฟใใใใใฎtipsใงใใ
ใใใใ
$ git add -A
ใใใชใ
force pushไธฆใฎๅคง็ฝชใใใๆใๆนใใใ
git add -pใจใฏ
Git - git-add Documentationใใใฎๅผ็จ
-p
--patch
Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the difference before adding modified contents to the index.This effectively runs add --interactive, but bypasses the initial command menu and directly jumps to the patch subcommand. See โInteractive modeโ for details.
่ฆใใใซaddใใๅ
ใซๅทฎๅใๅฏพ่ฉฑ็
ใซ็ขบ่ชใงใใใณใใณใใงใใ
Let's try
ใฏใผใญใณใฐใใชใผใซๅทฎๅใใใ็ถๆ
ใงใ $ git add -p
ใใฆใฟใฆใใ ใใใ
ใใใชๆใใซใชใใฏใใงใใ
ๅทฎๅใฎๅก(hunk)ใในใใผใธใใใใๅฏพ่ฉฑ็ใซ่ใใใใฎใงใ[y,n,q,a,d,e,?]ใไฝฟใฃใฆใๅฆ็ใใฆใใใพใใ
Stage this hunk [y,n,q,a,d,e,?]?
ๅฐใฃใใจใใฏ?
ใๅฎ่กใใฆใใ ใใใhelpใ่กจ็คบใใใพใใ
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
e - manually edit the current hunk
? - print help
ใชใใ ใ่ฒใ
ใใฃใฆไธๅฎใซใชใใใใใใพใใใใy
ใจn
ใฎ2ใคใ่ฆใใใฐๅคงไธๅคซใงใใ
y
ๅทฎๅใฎๅก(hunk)ใในใใผใธใณใฐใใพใใ
ๅทฎๅใฎๅ ๅฎนใ็ขบ่ชใๅ้กใชใใใฐy
ใงใใn
ๅทฎๅใฎๅก(hunk)ใในใใผใธใณใฐใใพใใใ
ๅทฎๅใฎๅ ๅฎนใ็ขบ่ชใๆๅณใใชใ็งๅฟๆ ๅ ฑใใใใใใฐใญใฐๅบๅ็ญใๅซใพใใฆใใๅ ดๅใฏn
ใงใใ
ไธใคๅฆ็ใใใจใพใๆฌกใฎๅทฎๅใ่ชๅ็ใซ่กจ็คบใใใๅ
จใฆใฎๅทฎๅใซๅฏพใใฆๅฆ็ใใใพใง็ถใใพใใ
โป q
ใงๅผทๅถ็ใซใใไปฅ้ใๅ
จใฆในใใผใธใณใฐใใใซadd -p
ใ็ตไบใใใใจใๅบๆฅใพใใ
ไธ่จใฎๅฆ็ใ็นฐใ่ฟใใฆในใใผใธใณใฐใๅฎไบใใใใใใคใใฎใใใซcommitใ่กใฃใฆใใ ใใใ
ๅ็
force pushไธฆใฎๅคง็ฝชใใใๆใๆนใใใ
ใจใใใใชใใใใตใณใใซใใญใธใงใฏใไฝใใจใใซ-Aใไฝฟใฃใฆใใพใใพใใใๆใๆนใใพใใ
Top comments (0)