Development

git flow (git branch 전략)

chbae 2023. 4. 20. 03:09
728x90
반응형

2010년 Vincent Driessen이 아래 Reference에 있는 A successful Git branching model이라는 글을 기고 하면서 널리 알려진 Git으로 개발하는 방법론이다.

 

Referencehttp://nvie.com/posts/a-successful-git-branching-model/

 

A successful Git branching model

In this post I present a Git branching strategy for developing and releasing software as I’ve used it in many of my projects, and which has turned out to be very successful.

nvie.com

표준 개발 진행 과정 (글 출처: 소셜 코딩으로 이끄는 GitHub 실천 기술)

  1. 개발 중 브랜치(develop)에서 작업 중 브랜치(feature)를 생성해 기증을 구현하거나 수정한다.
  2. 작업 중 브랜치(feature)에서 코드를 모두 작성하면, 개발 중 브랜치(development)에 merge한다.
  3. 1번과 2번을 반복하면서 배포할 수 있는 수준까지 개발한다.
  4. 배포를 위한 배포 전용 브랜치(release)를 생성한다.
  5. 배포 작업이 끝나면 master 브랜치에 merge하고, 버전 태그를 붙여서 배포한다.
  6. 배포하고 있는 소프트웨어에 버그가 있는 경우, 해당 버전을 기반(master에서 수정 branch 생성)으로 수정 (hotfixes)를 한다.

 

git-flow라는 툴은 이 개발 방법론을 쉽게 할 수 있도록 도와준다.

 

설치 (Ubuntu)

$ sudo apt-get install git-flow

 

사용 (Usage)

$ git flow  
usage: git flow <subcommand>  
Available subcommands are:  
  init   Initialize a new git repo with support for the branching model.  
  feature  Manage your feature branches.  
  release  Manage your release branches.  
  hotfix  Manage your hotfix branches.  
  support  Manage your support branches.  
  version  Shows version information.  
Try 'git flow <subcommand> help' for details.

 

git과 이 개발 방법론에 익숙한 개발자라면, git flow를 사용 안해도 되지만, 이 툴을 사용하면 실수를 방지하고 편하게 사용할 수 있다.

728x90