git flow

zooyahoยท2022๋…„ 7์›” 8์ผ
0
post-thumbnail
post-custom-banner

git flow

git branch model ์ค‘ ํ•˜๋‚˜

git switch develop
git merge --no-ff release/1.0
git switch master
git merge --no-ff release/1.0
git tag 1.0
git switch develop

๐Ÿ‘‰๐Ÿป git flow๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์œ„ ์ž‘์—…๋“ค์„ git flow release finish 1.0 ํ•œ์ค„๋กœ ๋๋‚ผ ์ˆ˜ ์žˆ์Œ.

git flow cli

$ git flow : ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” git flow cli๋ฅผ ์•Œ ์ˆ˜ ์žˆ์Œ.

โ— $ git flow init

  • git flow์ €์žฅ์†Œ๊ฐ€ ๋งŒ๋“ค์–ด์ง.
  • ๊ธฐ๋ณธ์ ์œผ๋กœ develop๋ธŒ๋žœ์น˜๋กœ ์ด๋™ํ•จ.
  • $ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        ignorecase = true
        precomposeunicode = true
[gitflow "branch"]
        master = master
        develop = develop
[gitflow "prefix"]
        feature = feature/
        bugfix = bugfix/
        release = release/
        hotfix = hotfix/
        support = support/
        versiontag = 

๐Ÿ‘‰๐Ÿป git flow์™€ ๊ด€๋ จ๋œ ์„ค์ •๋“ค์ด setting๋จ.

โ— git flow feature start ๋ธŒ๋žœ์น˜๋ช…

๐Ÿ‘พ git flow feature start login

๐Ÿ‘‰๐Ÿป feature/login ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ ํ›„ ์ „ํ™˜

โ— git push --set-upstream origin develop

  • $ git remote add origin ์›๊ฒฉ์ €์žฅ์†Œ
  • $ git push --set-upstream origin develop
    : ์›๊ฒฉ์˜ develop๊ณผ ๋กœ์ปฌ์˜ develop์„ ํ•œ๋ฒˆ์— ์—ฐ๊ฒฐ ์‹œ์ผœ ์คŒ.

โ— git flow feature publish ๋ธŒ๋žœ์น˜๋ช…

: ์›๊ฒฉ์ €์žฅ์†Œ feature์— ํ•ด๋‹น ๋ธŒ๋žœ์น˜๋ฅผ ๊ฐœ์‹œํ•จ

โ— git flow feature finish ๋ธŒ๋žœ์น˜๋ช…

: develop๋ธŒ๋žœ์น˜์— ํ•ด๋‹น feature๋ธŒ๋žœ์น˜๋ฅผ ๋ณ‘ํ•ฉํ•จ.
: ์ž๋™์œผ๋กœ ํ•ด๋‹น feature๋ธŒ๋žœ์น˜๋Š” ์‚ญ์ œ๋จ.

โ— git flow release start RELEASE[BASENAME]

: ์ถœ์‹œ ์ ˆ์ฐจ
: develop๋ธŒ๋žœ์น˜์˜ ๋‚ด์šฉ์ด release๋ธŒ๋žœ์น˜์— ๋“ค์–ด๊ฐ???

  • $ git flow release start 1.0 : release/1.0 ๋ธŒ๋žœ์น˜ ์ƒ์„ฑ

โ— git flow release finish RELEASE

  1. release๋ธŒ๋žœ์น˜๋ฅผ master๋ธŒ๋žœ์น˜์— ๋ณ‘ํ•ฉ -> ์ปค๋ฐ‹๋ฉ”์„ธ์ง€ ์ž‘์„ฑ
  2. release๋ธŒ๋žœ์น˜๋ฅผ ๋ฆด๋ฆฌ์Šค ์ด๋ฆ„์œผ๋กœ ํƒœ๊ทธ์„ค์ • -> ๋ฒ„์ „ ์ž‘์„ฑ
  3. release๋ธŒ๋žœ์น˜๋ฅผ develop๋ธŒ๋žœ์น˜๋กœ ์žฌ ๋ณ‘ํ•ฉ(back-merge) -> ์ปค๋ฐ‹๋ฉ”์„ธ์ง€ ์ž‘์„ฑ
    : release ๋ธŒ๋žœ์น˜ ์‚ญ์ œ
    ๐Ÿ“Ž git push --tags : ๋ฆด๋ฆฌ์Šค๋ฅผ ๋ฆด๋ฆฌ์Šค ์ด๋ฆ„์œผ๋กœ ํƒœ๊ทธ

โ— git flow hotfix start VERSION[BASENAME]

: ์ด๋ฏธ ์ถœ์‹œ๋œ master์—์„œ ๋ฌธ์ œ๊ฐ€ ๋˜๋Š” ์ฝ”๋“œ๋งŒ ๊ณ ์น˜๋Š” ์ž‘์—…์„ hotfix๋ธŒ๋žœ์น˜์—์„œ ๋‹ค๋ฃธ.
: ์ถœ์‹œ๋œ master๋ธŒ๋žœ์น˜๋ฅผ ๋ณต์ œํ•œ hotfix๋ธŒ๋žœ์น˜๋ฅผ ์ƒ์„ฑ ํ›„ ์ž‘์—…

โ— git flow hotfix finish VERSION

: ํ•ซํ”ฝ์Šค๋ฅผ ์ข…๋ฃŒํ•˜๋ฉด develop, master๋ธŒ๋žœ์น˜๋กœ ๋ณ€ํ•ฉ๋จ -> ์ˆœ์ฐจ์ ์œผ๋กœ master ์ปค๋ฐ‹๋ฉ”์„ธ์ง€ ์ž‘์„ฑ, ํƒœ๊ทธ ์ž‘์„ฑ, develop ์ปค๋ฐ‹๋ฉ”์„ธ์ง€ ์ž‘์„ฑ์œผ๋กœ ์ง„ํ–‰
: master์˜ ๋ณ‘ํ•ฉ ๋ถ€๋ถ„์€ ํ•ซํ”ฝ์Šค ๋ฒ„์ „์œผ๋กœ ํƒœ๊ทธ๋จ!!

์ฐธ๊ณ 
https://www.youtube.com/watch?v=w2F8O9J1keM
https://danielkummer.github.io/git-flow-cheatsheet/index.ko_KR.html
Megabyte School: ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ ์ทจ์—… ์—ฐ๊ณ„ ๊ณผ์ •, ์ตœ์šฐ์˜

profile
์ฆ๊ฒ๊ฒŒ ๊ฐœ๋ฐœํ•˜์ž ์ฅฌ์•ผํ˜ธ๐Ÿ‘ป
post-custom-banner

0๊ฐœ์˜ ๋Œ“๊ธ€