Skip to content

Latest commit

ย 

History

History
23 lines (18 loc) ยท 1.13 KB

14_rebase.md

File metadata and controls

23 lines (18 loc) ยท 1.13 KB

Rebase์™€ Cherry-Pick

Rebase! ํ•˜๋‚˜์˜ Branch๋กœ ๋ณ‘ํ•ฉํ•˜๊ธฐ

  • GIT์—์„œ ํ•œ branch์—์„œ ๋‹ค๋ฅธ branch๋กœ ํ•ฉ์น˜๋Š” ๋ฐฉ๋ฒ•์€ 2๊ฐ€์ง€์ด๋‹ค. ํ•˜๋‚˜๋Š” merge, ๋‹ค๋ฅธ ํ•˜๋‚˜๋Š” rebase์ด๋‹ค
  • ์•„๋ž˜์™€ ๊ฐ™์ด master branch์œ„์— ์žˆ์ง€ ์•Š์€ branch๋Š” fast-forward mergeํ•  ์ˆ˜ ์—†๋‹ค
  • ํ•˜์ง€๋งŒ git rebase ๋ธŒ๋žœ์น˜๋ช… ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด, ํ•˜๋‚˜์˜ branch๋กœ ํ•ฉ์ณ์ง€๋ฉด์„œ fast-forward merge๊ฐ€ ๊ฐ€๋Šฅํ•ด์ง„๋‹ค



Rebase --Onto

  • rebase๋Š” ๋‹จ์ˆœํžˆ branch๋ฅผ ํ•ฉ์น˜๋Š” ๊ฒƒ๋งŒ ์•„๋‹ˆ๋ผ ๋‹ค๋ฅธ ์šฉ๋„๋กœ๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค
  • rebase --onto ๋ช…๋ น์–ด๋ฅผ ์ด์šฉํ•˜๋ฉด ์—ฌ๋Ÿฌ branch๊ฐ€ ์„ž์—ฌ์žˆ๋Š” ์™€์ค‘์—๋„, ํŠน์ • branch๋งŒ rebase๊ฐ€ ๊ฐ€๋Šฅํ•˜๋‹ค



Cherry-Pick

  • GIT์—๋Š” ํŠน์ • commit๋งŒ ๋ฏธ๋ฆฌ rebaseํ•  ์ˆ˜ ์žˆ๋Š” ๊ธฐ๋Šฅ์ด ์žˆ๋‹ค
  • git cherry-pick ํ•ด์‹œํƒœ๊ทธ๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ํ•ด๋‹น commit๋งŒ rebase ๊ฐ€๋Šฅํ•˜๋‹ค