Skip to content

Latest commit

ย 

History

History
160 lines (83 loc) ยท 5.5 KB

Git vs GitHub vs GitLab Flow.md

File metadata and controls

160 lines (83 loc) ยท 5.5 KB

Git vs GitHub vs GitLab Flow


git-flow์˜ ์ข…๋ฅ˜๋Š” ํฌ๊ฒŒ 3๊ฐ€์ง€๋กœ ๋ถ„๋ฆฌ๋œ๋‹ค.
์–ด๋–ค ์ฐจ์ด์ ์ด ์žˆ๋Š”์ง€ ๊ฐ„๋‹จํžˆ ์•Œ์•„๋ณด์ž

1. Git Flow

๊ฐ€์žฅ ์ตœ์ดˆ๋กœ ์ œ์•ˆ๋œ Workflow ๋ฐฉ์‹์ด๋ฉฐ, ๋Œ€๊ทœ๋ชจ ํ”„๋กœ์ ํŠธ ๊ด€๋ฆฌ์— ์ ํ•ฉํ•œ ๋ฐฉ์‹์œผ๋กœ ํ‰๊ฐ€๋ฐ›๋Š”๋‹ค.

๊ธฐ๋ณธ ๋ธŒ๋žœ์น˜๋Š” 5๊ฐ€์ง€๋‹ค.

  • feature โ†’ develop โ†’ release โ†’ hotfix โ†’ master


Master

๋ฆด๋ฆฌ์ฆˆ ์‹œ ์‚ฌ์šฉํ•˜๋Š” ์ตœ์ข… ๋‹จ๊ณ„ ๋ฉ”์ธ ๋ธŒ๋žœ์น˜

Tag๋ฅผ ํ†ตํ•ด ๋ฒ„์ „ ๊ด€๋ฆฌ๋ฅผ ํ•œ๋‹ค.


Develop

๋‹ค์Œ ๋ฆด๋ฆฌ์ฆˆ ๋ฒ„์ „ ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•˜๋Š” ๋ธŒ๋žœ์น˜

์ถ”๊ฐ€ ๊ธฐ๋Šฅ ๊ตฌํ˜„์ด ํ•„์š”ํ•ด์ง€๋ฉด, ํ•ด๋‹น ๋ธŒ๋žœ์น˜์—์„œ ๋‹ค์‹œ ๋ธŒ๋žœ์น˜(Feature)๋ฅผ ๋‚ด์–ด ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•˜๊ณ , ์™„๋ฃŒ๋œ ๊ธฐ๋Šฅ์€ ๋‹ค์‹œ Develop ๋ธŒ๋žœ์น˜๋กœ Mergeํ•œ๋‹ค.


Feature

Develop ๋ธŒ๋žœ์น˜์—์„œ ๊ธฐ๋Šฅ ๊ตฌํ˜„์„ ํ•  ๋•Œ ๋งŒ๋“œ๋Š” ๋ธŒ๋žœ์น˜

ํ•œ ๊ธฐ๋Šฅ ๋‹จ์œ„๋งˆ๋‹ค Feature ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•˜๋Š”๊ฒŒ ์›์น™์ด๋‹ค.


Release

Develop์—์„œ ํŒŒ์ƒ๋œ ๋ธŒ๋žœ์น˜

Master ๋ธŒ๋žœ์น˜๋กœ ํ˜„์žฌ ์ฝ”๋“œ๊ฐ€ Merge ๋  ์ˆ˜ ์žˆ๋Š”์ง€ ํ…Œ์ŠคํŠธํ•˜๊ณ , ์ด ๊ณผ์ •์—์„œ ๋ฐœ์ƒํ•œ ๋ฒ„๊ทธ๋ฅผ ๊ณ ์น˜๋Š” ๊ณต๊ฐ„์ด๋‹ค. ํ™•์ธ ๊ฒฐ๊ณผ ์ด์ƒ์ด ์—†๋‹ค๋ฉด, ํ•ด๋‹น ๋ธŒ๋žœ์น˜๋Š” Master์™€ Mergeํ•œ๋‹ค.


Hotfix

Mater๋ธŒ๋žœ์น˜์˜ ๋ฒ„๊ทธ๋ฅผ ์ˆ˜์ •ํ•˜๋Š” ๋ธŒ๋žœ์น˜

๊ฒ€์ˆ˜๋ฅผ ํ•ด๋„ ๋ฆด๋ฆฌ์ฆˆ๋œ Master ๋ธŒ๋žœ์น˜์—์„œ ๋ฒ„๊ทธ๊ฐ€ ๋ฐœ๊ฒฌ๋˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์กด์žฌํ•œ๋‹ค. ์ด๋•Œ Hotfix ๋ธŒ๋žœ์น˜๋ฅผ ๋‚ด์–ด ๋ฒ„๊ทธ ์ˆ˜์ •์„ ์ง„ํ–‰ํ•œ๋‹ค. ๋””๋ฒ„๊ทธ๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด Master, Develop ๋ธŒ๋žœ์น˜์— Mergeํ•ด์ฃผ๊ณ  ๋ธŒ๋žœ์น˜๋ฅผ ๋‹ซ๋Š”๋‹ค.


git-flow์—์„œ ๊ฐ€์žฅ ์ค‘์‹ฌ์ด ๋˜๋Š” ๋ธŒ๋žœ์น˜๋Š” master์™€ develop์ด๋‹ค. (๋ฌด์กฐ๊ฑด ํ•„์š”)

์ด๋ฆ„์„ ๋ณ€๊ฒฝํ•  ์ˆ˜๋Š” ์žˆ์ง€๋งŒ, ํ†ต์ƒ์ ์œผ๋กœ ์‚ฌ์šฉํ•˜๋Š” ์ด๋ฆ„์ด๋ฏ€๋กœ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•˜๋„๋ก ํ•˜์ž

์ง„ํ–‰ ๊ณผ์ • ์ค‘์— Merge๋œ feature, release, hotfix ๋ธŒ๋žœ์น˜๋Š” ๋‹ซ์•„์„œ ์‚ญ์ œํ•˜๋„๋ก ํ•œ๋‹ค.

์ด์ฒ˜๋Ÿผ ๊ณ„ํš์ ์ธ ๋ฆด๋ฆฌ์ฆˆ๋ฅผ ๊ฐ€์ง€๊ณ  ์Šค์ผ€์ค„์ด ์งœ์—ฌ์ง„ ๋Œ€๊ทœ๋ชจ ํ”„๋กœ์ ํŠธ์—๋Š” git-flow๊ฐ€ ์ ํ•ฉํ•˜๋‹ค. ํ•˜์ง€๋งŒ ๋Œ€๋ถ€๋ถ„ ์ผ๋ฐ˜์ ์ธ ํ”„๋กœ์ ํŠธ์—์„œ๋Š” ๋ถˆํ•„์š”ํ•œ ์ ˆ์ฐจ๋“ค์ด ๋งŽ์•„ ์ƒ์‚ฐ์„ฑ์„ ๋–จ์–ด๋œจ๋ฆฐ๋‹ค๋Š” ์˜๊ฒฌ๋„ ๋งŽ์€ ๋ฐฉ์‹์ด๋‹ค.


2. GitHub Flow

git-flow๋ฅผ ๊ฐœ์„ ํ•˜๊ธฐ ์œ„ํ•ด ๋‚˜์˜จ ํ•˜๋‚˜์˜ ๋ฐฉ์‹

ํ๋ฆ„์ด ๋‹จ์ˆœํ•œ ๋งŒํผ, ์—ญํ• ๋„ ๋‹จ์ˆœํ•˜๋‹ค. git flow์˜ hotfix๋‚˜ feature ๋ธŒ๋žœ์น˜๋ฅผ ๊ตฌ๋ถ„ํ•˜์ง€ ์•Š๊ณ , pull request๋ฅผ ๊ถŒ์žฅํ•œ๋‹ค.



Master ๋ธŒ๋žœ์น˜๊ฐ€ ๋ฆด๋ฆฌ์ฆˆ์— ์žˆ์–ด ์ ˆ๋Œ€์  ์—ญํ• ์„ ํ•œ๋‹ค.

Master ๋ธŒ๋žœ์น˜๋Š” ํ•ญ์ƒ ์ตœ์‹ ์œผ๋กœ ์œ ์ง€ํ•˜๋ฉฐ, Stableํ•œ ์ƒํƒœ๋กœ product์— ๋ฐฐํฌ๋˜๋Š” ๋ธŒ๋žœ์น˜๋‹ค.

๋”ฐ๋ผ์„œ Merge ์ „์— ์ถฉ๋ถ„ํ•œ ํ…Œ์ŠคํŠธ ๊ณผ์ •์„ ๊ฑฐ์ณ์•ผ ํ•œ๋‹ค. (๋ธŒ๋žœ์น˜๋ฅผ pushํ•˜๊ณ  Jenkins๋กœ ํ…Œ์ŠคํŠธ)


์ƒˆ๋กœ์šด ๋ธŒ๋žœ์น˜๋Š” ํ•ญ์ƒ Master ๋ธŒ๋žœ์น˜์—์„œ ๋งŒ๋“ค๋ฉฐ, ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ ์ถ”๊ฐ€๋‚˜ ๋ฒ„๊ทธ ํ•ด๊ฒฐ์„ ์œ„ํ•œ ๋ธŒ๋žœ์น˜๋Š” ํ•ด๋‹น ์—ญํ• ์— ๋Œ€ํ•œ ์ด๋ฆ„์„ ๋ช…ํ™•ํ•˜๊ฒŒ ์ง€์–ด์ฃผ๊ณ , ์ปค๋ฐ‹ ๋ฉ”์‹œ์ง€ ๋˜ํ•œ ์•Œ๊ธฐ ์‰ฝ๋„๋ก ์ž‘์„ฑํ•ด์•ผ ํ•œ๋‹ค.

๊ทธ๋ฆฌ๊ณ  Merge ์ „์—๋Š” pull request๋ฅผ ํ†ตํ•ด ๊ณต์œ ํ•˜์—ฌ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ํ”ผ๋“œ๋ฐฑ์„ ๋ฐ›๊ณ , Merge ์ค€๋น„๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด Master ๋ธŒ๋žœ์น˜๋กœ ์š”์ฒญํ•˜๊ฒŒ ๋œ๋‹ค.

์ด Merge๋Š” ๋ฐ”๋กœ product์— ๋ฐ˜์˜๋˜๋ฏ€๋กœ ์ถฉ๋ถ„ํ•œ ๋…ผ์˜๊ฐ€ ํ•„์š”ํ•˜๋ฉฐ CI๋„ ํ•„์ˆ˜์ ์ด๋‹ค.

Merge๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด, push๋ฅผ ์ง„ํ–‰ํ•˜๊ณ  ์ž๋™์œผ๋กœ ๋ฐฐํฌ๊ฐ€ ์™„๋ฃŒ๋œ๋‹ค. (GitHub-flow์˜ ํ•ต์‹ฌ์ ์ธ ๋ถ€๋ถ„)


CI (Continuous Integration)

  • ํ˜•์ƒ๊ด€๋ฆฌ ํ•ญ๋ชฉ์— ๋Œ€ํ•œ ์„ ์ •๊ณผ ํ˜•์ƒ๊ด€๋ฆฌ ๊ตฌ์„ฑ ๋ฐฉ์‹ ๊ฒฐ์ •

  • ๋นŒ๋“œ/๋ฐฐํฌ ์ž๋™ํ™” ๋ฐฉ์‹

  • ๋‹จ์œ„ํ…Œ์ŠคํŠธ/ํ†ตํ•ฉํ…Œ์ŠคํŠธ ๋ฐฉ์‹

์ด ์„ธ๊ฐ€์ง€๋ฅผ ๋ชจ๋‘ ๊ณ ๋ คํ•œ ์ž๋™ํ™”๋œ ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ตฌ์„ฑํ•˜๋Š” ๊ฒƒ



3. GitLab Flow

github flow์˜ ๊ฐ„๋‹จํ•œ ๋ฐฐํฌ ์ด์Šˆ๋ฅผ ๋ณด์™„ํ•˜๊ธฐ ์œ„ํ•ด ๊ด€๋ จ ๋‚ด์šฉ์„ ์ถ”๊ฐ€๋กœ ๋ง๋ถ™์ธ flow ๋ฐฉ์‹



Production ๋ธŒ๋žœ์น˜๊ฐ€ ์กด์žฌํ•˜์—ฌ ์ปค๋ฐ‹ ๋‚ด์šฉ์„ ์ผ๋ฐฉ์ ์œผ๋กœ Deploy ํ•˜๋Š” ํ˜•ํƒœ๋ฅผ ๊ฐ–์ถ”๊ณ  ์žˆ๋‹ค.

Master ๋ธŒ๋žœ์น˜์™€ Production ๋ธŒ๋žœ์น˜ ์‚ฌ์ด์— pre-production ๋ธŒ๋žœ์น˜๋ฅผ ๋‘์–ด ๊ฐœ๋ฐœ ๋‚ด์šฉ์„ ๋ฐ”๋กœ ๋ฐ˜์˜ํ•˜์ง€ ์•Š๊ณ , ์‹œ๊ฐ„์„ ๋‘๊ณ  ๋ฐ˜์˜ํ•œ๋‹ค. ์ด๋ฅผ ํ†ตํ•œ ์ด์ ์€, Production ๋ธŒ๋žœ์น˜์—์„œ ๋ฆด๋ฆฌ์ฆˆ๋œ ์ฝ”๋“œ๊ฐ€ ํ•ญ์ƒ ํ”„๋กœ์ ํŠธ์˜ ์ตœ์‹  ๋ฒ„์ „ ์ƒํƒœ๋ฅผ ์œ ์ง€ํ•  ํ•„์š”๊ฐ€ ์—†๋Š” ๊ฒƒ์ด๋‹ค.

์ฆ‰, github-flow์˜ ๋‹จ์ ์ธ ์•ˆ์ •์„ฑ๊ณผ ๋ฐฐํฌ ์‹œ๊ธฐ ์กฐ์ ˆ์— ๋Œ€ํ•œ ๋ถ€๋ถ„์„ production์ด๋ผ๋Š” ์ถ”๊ฐ€ ๋ธŒ๋žœ์น˜๋ฅผ ๋‘์–ด ๋ณด๊ฐ•ํ•˜๋Š” ์ „๋ ฅ์ด๋ผ๊ณ  ๋ณผ ์ˆ˜ ์žˆ๋‹ค.



์ •๋ฆฌ

3๊ฐ€์ง€ ๋ฐฉ๋ฒ• ์ค‘ ๋ฌด์—‡์ด ๊ฐ€์žฅ ๋‚˜์€ ๋ฐฉ์‹์ด๋ผ๊ณ  ์„ ํƒํ•  ์ˆ˜ ์—†๋‹ค. ํ”„๋กœ์ ํŠธ, ๊ฐœ๋ฐœ์ž, ๋ฆด๋ฆฌ์ฆˆ ๊ณ„ํš ๋“ฑ ์ƒํ™ฉ์— ๋”ฐ๋ผ ์ ํ•ฉํ•œ ๋ฐฉ๋ฒ•์„ ํƒํ•ด์•ผ ํ•œ๋‹ค.

๋ฐฐ๋‹ฌ์˜ ๋ฏผ์กฑ์ธ '์šฐ์•„ํ•œ ํ˜•์ œ๋“ค'์ด github-flow์—์„œ git-flow๋กœ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ๋ณ€๊ฒฝํ•œ ๊ฒƒ ์ฒ˜๋Ÿผ (ํ•ด๋‹น ๊ธฐ์‚ฌ ๋งํฌ) ๋ธŒ๋žœ์นญ๊ณผ ๋ฐฐํฌ์— ๋Œ€ํ•œ ์ „๋žต ์ƒํ™ฉ์— ๋”ฐ๋ผ ๋ณ€๊ฒฝ์ด ๊ฐ€๋Šฅํ•œ ๋ถ€๋ถ„์ด๋‹ค.

๋”ฐ๋ผ์„œ ๊ฐ์ž ํŒ€์˜ ์ƒํ™ฉ์— ๋งž๊ฒŒ ์ ์ ˆํ•œ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์„ ํƒํ•˜์—ฌ ์ƒ์‚ฐ์„ฑ์„ ๋†’์ด๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•  ๊ฒƒ์ด๋‹ค.



[์ฐธ๊ณ  ์ž๋ฃŒ]