Git & Github

[ Git, Github ] Git ํ˜‘์—… ํ”Œ๋กœ์šฐ ์ข…๋ฅ˜, Git-flow

Forest Yun 2021. 9. 24. 00:02
728x90

๊ณต๋ถ€ํ•œ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•œ ๊ธ€์ž…๋‹ˆ๋‹ค.

 

 

 

 

Git๊ณผ Github

  1. Git ํ˜‘์—… ํ”Œ๋กœ์šฐ
  2. Git-flow๋ž€?

 

 

 

 

 

 

 

 

 


1. Git ํ˜‘์—… ์›Œํฌํ”Œ๋กœ์šฐ

 

1.1 Centralized workflow ๋‹จ์ผ ์ค‘์•™ ์ €์žฅ์†Œ ์ง‘์ค‘ํ˜•

๋‹จ์ผ ์ค‘์•™ ์ €์žฅ์†Œ์™€ master ๋ธŒ๋žœ์น˜๋ฅผ ์ด์šฉํ•œ ์›Œํฌ ํ”Œ๋กœ์šฐ

 

 

 

 

 

 

 

 

 

1.2 Feature Branch Workflow

๊ธฐ๋Šฅ๋ณ„ ๋ธŒ๋žœ์น˜๋ฅผ ๋งŒ๋“ค์–ด ๊ทธ ๋ธŒ๋žœ์น˜์—์„œ๋งŒ ์ž‘์—…์ด ์ด๋ฃจ์–ด์ง„๋‹ค. ์ž‘์—…์ด ๋๋‚˜๋ฉด ๊ธฐ๋Šฅ ๋ธŒ๋žœ์น˜๋ฅผ master ๋ธŒ๋žœ์น˜๋กœ ๋ณ‘ํ•ฉํ•œ๋‹ค.

 

 

 

 

 

 

 

 

 

1.3 Gitflow Workflow

์•„๋ž˜ ์ž์„ธํ•œ ์„ค๋ช… ์ž‘์„ฑ.

 

 

 

 

 

 

 

1.4 Forking Workflow

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


2. Git-flow๋ž€?

๋ฐฐํฌ ์‚ฌ์ดํด์„ ์ค‘์‹ฌ์œผ๋กœ ๋ธŒ๋žœ์น˜๋ฅผ ๊ตฌ์„ฑํ•˜์—ฌ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•œ๋‹ค. ๊ฐ ๋ธŒ๋žœ์น˜๋งˆ๋‹ค ํŠน์ •ํ•œ ์—ญํ• ๊ณผ ์–ธ์ œ/์–ด๋–ป๊ฒŒ ๊ฐ ๋ธŒ๋žœ์น˜๋“ค์ด ์„œ๋กœ ์ƒํ˜ธ์ž‘์šฉํ• ์ง€ ์ •์˜ํ•˜์—ฌ ์‚ฌ์šฉํ•œ๋‹ค.

๋ธŒ๋žœ์น˜๋Š” 5๊ฐ€์ง€ ์ข…๋ฅ˜๊ฐ€ ์žˆ๋‹ค. ํ•ญ์ƒ ์œ ์ง€๋˜๋Š” ๋ฉ”์ธ ๋ธŒ๋žœ์น˜ master, develop ์ด ์žˆ์œผ๋ฉฐ, ์ผ์ • ๊ธฐ๊ฐ„๋™์•ˆ ์œ ์ง€๋˜์—ˆ๋‹ค๊ฐ€ ์‚ฌ์šฉ์ด ์™„๋ฃŒ๋˜๋ฉด ์‚ญ์ œํ•˜๋Š” ๋ณด์กฐ ๋ธŒ๋žœ์น˜ feature, release, hotfix ๊ฐ€ ์žˆ๋‹ค.

 

 master(main)  ๋ฐฐํฌ ์ด๋ ฅ ๊ธฐ๋ก(ํƒœ๊ทธ) ๋ฆด๋ฆฌ์ฆˆ(๋ฐฐํฌ)์ด๋ ฅ์„ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•œ๋‹ค. ์ œํ’ˆ์œผ๋กœ ์ถœ์‹œ๋  ์ˆ˜ ์žˆ๋Š” ๋ธŒ๋žœ์น˜
 develop  ๊ฐœ๋ฐœ ๋ธŒ๋žœ์น˜ feature ๋ธŒ๋žœ์น˜๋“ค์„ ๋ณ‘ํ•ฉํ•˜๋Š” ๋ธŒ๋žœ์น˜. ๋‹ค์Œ ์ถœ์‹œ ๋ฒ„์ „์„ ๊ฐœ๋ฐœํ•˜๋Š” ๋ธŒ๋žœ์น˜.
master ๋ธŒ๋žœ์น˜์—์„œ ์ƒ์„ฑํ•œ๋‹ค.
 feature  ๊ธฐ๋Šฅ ๋ธŒ๋žœ์น˜ ๊ธฐ๋Šฅ์„ ๊ฐœ๋ฐœํ•˜๋Š” ๋ธŒ๋žœ์น˜.
develop์—์„œ feature ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
feature ๋ธŒ๋žœ์น˜๋Š” develop ๋ธŒ๋žœ์น˜์™€ ์ƒํ˜ธ์ž‘์šฉ ํ•œ๋‹ค. master์™€๋Š” ์–ด๋– ํ•œ ์—ฐ๊ฒฐ๋„ ์—†๋‹ค.
 release  ๋ฐฐํฌ ์ค€๋น„ ๋ธŒ๋žœ์น˜
(๋ฐฐํฌ ์ „ ๋ฒ„๊ทธ)
๋ฐฐํฌ ์ผ์ •์ด ๋˜๋ฉด, develop ๋ธŒ๋žœ์น˜๋ฅผ ๊ธฐ์ค€์œผ๋กœ ๋ฐฐํฌ๋ฅผ ์œ„ํ•œ release ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
๋ณดํ†ต QA ์‹œ develop ๋ธŒ๋žœ์น˜์—์„œ release ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•œ๋‹ค.
๋ฒ„๊ทธ ์ˆ˜์ •, ๋ฌธ์„œ ์ถ”๊ฐ€ ๋“ฑ ๋ฐฐํฌ์™€ ์ง์ ‘์ ์œผ๋กœ ๊ด€๋ จ๋œ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•œ๋‹ค. ๋ฐฐํฌ๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด master ๋ธŒ๋žœ์น˜์— ๋ณ‘ํ•ฉํ•œ๋‹ค. ๋ฐฐํฌ ์ค€๋น„๋ฅผ ํ•˜๋Š” ๋™์•ˆ develop ๋ธŒ๋žœ์น˜๊ฐ€ ๋ณ€๊ฒฝ๋˜์—ˆ์„ ์ˆ˜๋„ ์žˆ์œผ๋ฏ€๋กœ develop ๋ธŒ๋žœ์น˜์—๋„ ๋ณ‘ํ•ฉํ•œ๋‹ค.
๋ณดํ†ต release-* ๋˜๋Š” release/* ์œผ๋กœ ์ด๋ฆ„์„ ์ง“๋Š”๋‹ค.
 hotfix  ์œ ์ง€๋ณด์ˆ˜ ๋ธŒ๋žœ์น˜
(๋ฐฐํฌ ํ›„ ๋ฒ„๊ทธ)
๋ฐฐํฌ ํ›„ ์ƒ๊ธด ๋ฒ„๊ทธ ๋“ฑ์˜ ๊ธด๊ธ‰ ํŒจ์น˜๋ฅผ ์ ์šฉํ•˜๋Š” ๋ธŒ๋žœ์น˜.
master์—์„œ hotfix ๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑํ•œ๋‹ค. ๋ณด์ˆ˜๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด master์™€ develop ๋ธŒ๋žœ์น˜์— ๋ณ‘ํ•ฉํ•˜๊ณ , ์ƒˆ๋กœ์šด ๋ฒ„์ „์œผ๋กœ ํƒœ๊ทธํ•œ๋‹ค.

 

 

 

 

์ž์„ธํ•œ ์‚ฌ์šฉ์€ ๊ณต๋ถ€ ์ž๋ฃŒ์˜€๋˜ '์šฐ์•„ํ•œ ํ˜•์ œ๋“ค ๊ธฐ์ˆ  ๋ธ”๋กœ๊ทธ : ์šฐ๋ฆฐ Git-flow๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด์š”'์˜ 'Git-flow๋ฅผ ์ด๋ ‡๊ฒŒ ํ•˜๊ณ  ์žˆ์–ด์š”' ๋ถ€๋ถ„์—์„œ ํ™•์ธํ•˜์ž.

https://techblog.woowahan.com/2553/

 

์šฐ๋ฆฐ Git-flow๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด์š” | ์šฐ์•„ํ•œํ˜•์ œ๋“ค ๊ธฐ์ˆ ๋ธ”๋กœ๊ทธ

{{item.name}} ์•ˆ๋…•ํ•˜์„ธ์š”. ์šฐ์•„ํ•œํ˜•์ œ๋“ค ๋ฐฐ๋ฏผํ”„๋ก ํŠธ๊ฐœ๋ฐœํŒ€์—์„œ ์•ˆ๋“œ๋กœ์ด๋“œ ์•ฑ ๊ฐœ๋ฐœ์„ ํ•˜๊ณ  ์žˆ๋Š” ๋‚˜๋™ํ˜ธ์ž…๋‹ˆ๋‹ค. ์˜ค๋Š˜์€ ์ €ํฌ ์•ˆ๋“œ๋กœ์ด๋“œ ํŒŒํŠธ์—์„œ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋Š” Git ๋ธŒ๋žœ์น˜ ์ „๋žต์„ ์†Œ๊ฐœํ•˜๋ ค๊ณ  ํ•ฉ

techblog.woowahan.com

 

 

 

 

 

 

 

 

 

 

 

 

 

 

๊ณต๋ถ€์ž๋ฃŒ

https://shilan.tistory.com/entry/๊ฐœ์ธ-ํ”„๋กœ์ ํŠธ-Git-๊ด€๋ฆฌ
https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
https://nvie.com/posts/a-successful-git-branching-model/
์šฐ์•„ํ•œ ํ˜•์ œ๋“ค ๊ธฐ์ˆ  ๋ธ”๋กœ๊ทธ : ์šฐ๋ฆฐ Git-flow๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์–ด์š” https://techblog.woowahan.com/2553/ 
https://www.inbogi.com/bok/2020/04/1/
https://parkadd.tistory.com/m/101?category=967882
728x90

'Git & Github' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[ Git , Github ] Git๊ณผ Github๋ž€?  (0) 2021.09.21