05. git rebase practice: problem - nephilim/js-git-kata GitHub Wiki
์ฃผ์ : merge ๋ด์ญ ๋๋๋ฆฌ๊ธฐ ์ค์ต
- ์งํ ์๋ น
-
git-test-l7.tgz๋ฅผ ๋ค์ด๋ฐ์ ์ ๋นํ ์์น์ ์์ถ์ ํ๋๋ค.
-
test.txt์ ๋ด์ฉ์ ํ์ธํฉ๋๋ค. ๋ค๋ฅธ ์ค๊ณผ ๋ฌ๋ฆฌ line5๋ง ๋์ "์ด ์ถ๊ฐ๋์ด ์์ต๋๋ค.
line1 line2 line3 line4 line5" line6 line7
-
ํ์ฌ๊น์ง๋ ๋ก์ปฌ์์๋ง ์์ ์ด ์ด๋ค์ก๊ณ ์๋ฒ์ ๋ฐ์ํ์ง๋ ์์์ผ๋ฏ๋ก, ํด๋น ์์ ์ผ๋ก ๊ฑฐ์ฌ๋ฌ์ฌ๋ผ๊ฐ line5"๋ฅผ line5๋ก ์์ ํ๋ ค๊ณ ํฉ๋๋ค.
-
์์ ์ line๊ณผ master๋ธ๋์น mergeํ line6๊ณผ line7์ด ์ถ๊ฐ๋ ์ํฉ์ ๋๋ค. (๋ค์์ git-graph๋ฅผ ์ฐธ๊ณ ํฉ๋๋ค.)
* f70ec47 - (HEAD, master) line7 added (58 seconds ago) * 8411c8c - line6 added (21 minutes ago) * b781d82 - merged with line(3,4) (22 minutes ago) |\ | * 9c6da70 - (line) line4 added (2 weeks ago) | * d9161bf - line3 added (2 weeks ago) * | 07ea1bc - line5 added (37 minutes ago) |/ * 21bb6d0 - line2 added (3 weeks ago) * 3a55ae2 - line1 added (3 weeks ago) * a3d8a4f - initial commit (3 weeks ago)
-
์ฃผ์
- ๊ฑฐ์ฌ๋ฌ ์ฌ๋ผ๊ฐ ์ด์ ์์ ์ ์์ ํ๋๊ฒ ํต์ฌ์ ๋๋ค.
- git์ ๋ํ ์ดํด๋ฅผ ๋์ฌ์ฃผ๊ณ , ๋ค์ํ ๋ช ๋ น์ด๋ฅผ ์ตํ ์ ์์ด ํด๋ณด๋ ์ค์ต์ ๋๋ค. 3์ ์ ์ํด์ฃผ์ธ์.
- ์๋ฒ์ ๋ฐ์ํ๋ค๋ฉด commit history๋ฅผ ๋ณ๊ฒฝํ๋ ์์ ์ ์ํํฉ๋๋ค(์ด ๊ฒฝ์ฐ, git revert๋ฅผ ์ฐธ๊ณ ํ์ธ์).
- ๋ค์ํ ๋ฐฉ๋ฒ์ด ๊ฐ๋ฅํฉ๋๋ค๋ง, ๊ฐ๋ฅํ๋ฉด ํ์คํ ๋ฆฌ ์งํ ๋ด์ฉ์ ๋ฐ์ํ๋ ๋ฐฉ๋ฒ ๋ํ ๊ณ ๋ฏผํด ์ฃผ์ธ์.