๐ฏ Goals
- Merge ์ Rebase ์ ์ฐจ์ด์ ์ ์๋ค.
๊ฒฐ๋ก
์ ๋งํ๋ฉด merge ์จ๋ผ, commit ํ์คํ ๋ฆฌ๋ฅผ ์ ์งํ ์ ์๋ค.
โ ๏ธ Merge request ์ค์์๋ 'squash' ๋ ๋จ ํ๋์ Merge request (Pull Requset) ์ด๋ ฅ๋ง ๋จ๊ธฐ๊ณ ๋๋จธ์ง๋ ์ฌ๋ผ์ง๊ฒํ๋ค.

Merge & Pull Request
๋ณ๋์ ๋ณํฉ ํ์คํ ๋ฆฌ ์ปค๋ฐ์ ์์ฑํ๋ค.
๋ฆฌ๋ทฐ, ํ ์คํธ ๋ฑ์ ์ ๊ณตํ์ฌ "์ฌ๊ธฐ๊ฐ ์ด์ด์ง๋ ์ปค๋ฐ์ด์์!" ๋ผ๋ ์ด๋ ฅ์ ๋จ๊ธด๋ค.
Rebase

๋ณ๋์ ๋ณํฉ ํ์คํ ๋ฆฌ ์ปค๋ฐ ์์ด ๊ณง๋ฐ๋ก ๊น๋ํ๊ฒ ์ด์ด๋ถ์ด๊ธฐ ํ๋ ์ฉ๋๋ค.
๋ฆฌ๋ทฐ, ํ ์คํธ ๋ฑ์ด ํ์ํ์ง ์๊ฒ ์ผ๊ด๋ ํ์คํ ๋ฆฌ๋ฅผ ์ ์งํ ์ ์๋ค.
Why to use
- ๊นจ๋ํ ์ปค๋ฐ ํ์คํ ๋ฆฌ ์ ๋ฆฌ
Merge ์ปค๋ฐ์ด ์์ฑ๋์ง ์๋๋ค.
When to use
- ๋ ํผ์ ๊ด๋ฆฌํ๋ ๋ธ๋์น์ ์ปค๋ฐ ํ์คํ ๋ฆฌ๋ฅผ ์ ๋ ฌํ ๋
- ๊ณผ๊ฑฐ ์ฌ๋ฌ commit ์ ํ๋๋ก ํฉ์น๋ squash ์์
- ๋ด๊ฐ ๋ง๋ ์ปค๋ฐ ํ์คํ ๋ฆฌ๋ฅผ ํน์ ๋ธ๋์น ๋ค์ append (๋ง๋ถ์ด๊ธฐ) ํ ๋
rebase ๋ ๊ณผ๊ฑฐ history ๋ฅผ ๋ณ๊ฒฝํ๋ ์์ ์ด๊ธฐ ๋๋ฌธ์ ๋ค๋ฅธ ์ฌ๋๊ณผ ๊ณต์ ๋ ๋ธ๋์น์ ์ฌ์ฉํ๋ ๊ฒ์ ์ํํ๋ค.
(๋ถ๊ฐ๋ฅ ํ๋จ ๊ฒ์ ์๋๋ค.)
Pros & Cons
Pros
- commit history ๊ฐ ํ ์ค๋ก ๊น๋ํด์ง๋ค.
Cons
- ๋ค๋ฅธ ์ฌ๋๋ค๊ณผ ๊ณต์ ๋ ๋ธ๋์น์ ์ ์ฉ์ด ์ด๋ ต๋ค.
- ์ผ๋ถ ์ปค๋ฐ ํ์คํ ๋ฆฌ๊ฐ ์ ์ค๋ ์ ์๋ค.
(squash ๋ฑ)
์์ ๋งํฌ
Feature/c2 merge into develop by milkcoke · Pull Request #7 · milkcoke/git-repo-practice
$ git rebase <origin/develop> It should be skipped automatically which not conflict commit messages. Conflict occurs? resolve it and git add . and git rebase --continue You will show next log. ...
github.com
๐ Reference
Differences Between Git Merge and Rebaseโ—โand Why You Should Care
A comparison of git merge and rebase commands and when to use them
betterprogramming.pub
๋๊ตฌ๋ ์ฝ๊ฒ ์ดํดํ ์ ์๋ Git ์ ๋ฌธ~๋ฒ์ ๊ด๋ฆฌ๋ฅผ ์๋ฒฝํ๊ฒ ์ด์ฉํด๋ณด์~ | Backlog
๋๊ตฌ๋ ์ฝ๊ฒ ์ ์ ์๋ Git์ ์ ๋ฌธํ์ ๊ฒ์ ํ์ํฉ๋๋ค. Git์ ์ฌ์ฉํด ๋ฒ์ ๊ด๋ฆฌ๋ฅผ ํ ์ ์๋๋ก ํจ๊ป ๊ณต๋ถํด๋ด ์๋ค!
backlog.com
'๊ธฐํ > git' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [git] ์ด์ commit ๋ก๊ทธ ๋ณ๊ฒฝ (0) | 2022.03.12 |
|---|---|
| [Error] git push Error (non-fast-forward) (0) | 2022.03.11 |
| [Git] config (0) | 2021.11.11 |
| [Git] Security Vulnerabilities (๋ณด์ ๋ฌธ์ ํด๊ฒฐ) (0) | 2021.05.12 |
| [Git] branch (0) | 2021.03.29 |