Skip to content

Latest commit

Β 

History

History
28 lines (21 loc) Β· 1.31 KB

12_merge.md

File metadata and controls

28 lines (21 loc) Β· 1.31 KB

Merge! ν•˜λ‚˜μ˜ Branch둜 λ³‘ν•©ν•˜κΈ°

Fast-Forward Merge

  • branchμ—μ„œμ˜ μž‘μ—…μ΄ μ™„λ£Œλ˜μ—ˆλ‹€λ©΄, mergeλ₯Ό μ΄μš©ν•˜μ—¬ branch듀을 병합할 수 μžˆλ‹€
  • master branch μœ„μ— μžˆλŠ” branchλ₯Ό λ³‘ν•©ν•˜λ €λ©΄ git merge 브랜치λͺ…을 μž…λ ₯ν•˜λ©΄ λœλ‹€



no-ff

  • fast-forward mergeλ₯Ό ν•˜κ³  branch μ§€μ›Œλ²„λ¦¬λ©΄, ν•΄λ‹Ή branch의 쑴재 자체λ₯Ό μ•Œ μˆ˜κ°€ μ—†λ‹€
  • mergeν•œ 흔적을 log둜 남기고 싢을 λ•Œμ—λŠ” --no-ff μ˜΅μ…˜μ„ μ΄μš©ν•˜λ©΄ λœλ‹€
  • ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•΄ branch ν•˜λ‚˜λ₯Ό 더 λ§Œλ“€μ–΄ 보자

  • mergeλ₯Ό μœ„ν•΄ master branch둜 μ΄λ™ν•œ ν›„ git merge 브랜치λͺ… --no-ffλ₯Ό μž…λ ₯ν•˜λ©΄ λœλ‹€
  • μ΄λ ‡κ²Œ ν•˜λ©΄ fast-forward mergeμ™€λŠ” λ‹€λ₯΄κ²Œ log에 mergeν•œ 흔적이 λ‚¨κ²Œ λœλ‹€



Three-Way Merge

  • master branch μœ„μ— μžˆμ§€ μ•Šμ€ branch와 병합을 ν•˜λ €λ©΄ μ–΄λ–»κ²Œ ν•΄μ•Όν• κΉŒ?
  • μœ„μ™€ λ§ˆμ°¬κ°€μ§€λ‘œ git merge 브랜치λͺ…을 μž…λ ₯ν•˜λ©΄ three-way mergeκ°€ λœλ‹€