먼저 git flow를 설치한다.

http://knight76.tistory.com/entry/cygwin-에서-git-flow-설치

http://knight76.tistory.com/entry/윈도우-Git-Bash에-Git-flow-설치-installation-할-수-있도록-하는-팁

 

 

master 만 사용하고 있는 경우를 근거로 설명한다.  (다른 branch들이 존재할 때는 어떻게 해야 할지 몰라서.. 그냥 이렇게 했음. 마침 다른 branch도 안쓰고 있어서.. )

 

git flow init 실행하고 디폴트로 실행 (master branch였음)

 

$ git flow init
Branch name for "next release" development: [develop]

How to name your supporting branch prefixes?
Feature branches? [feature/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []

 

cygwin 화면에서 develop으로 변경되었음을 확인할 수 있다.

$ git branch
* develop
  master

 

이제 하고 싶은 기능을 추가한다. feature 등록

$ git flow feature start feature-30table-integration

……

Switched to a new branch 'feature/feature-30table-integration'

Summary of actions:
- A new branch 'feature/feature-30table-integration' was created, based on 'develop'
- You are now on branch 'feature/feature-30table-integration'

Now, start committing on your feature. When done, use:

     git flow feature finish feature-30table-integration

 

 

 

$ git branch
  develop
* feature/feature-30table-integration
  master

 

열심히 코딩 작업을 한고 난 후, commit과 push를 실행한다.

$ git add .
$ git commit -m 'added ...'
$ git push

 

기능을 종료하면 finish 한다. 그러면 자동으로 develop branch로 머징이 되고. feature 는 삭제된다.  


$ git flow feature finish feature-30table-integration
Switched to branch 'develop'
Updating 6db00ac..aa6072b
Fast-forward
.............

 9 files changed, 1009 insertions(+), 98 deletions(-)
 create mode 100644 src/main/resources/search.sql
Deleted branch feature/feature-30table-integration (was aa6072b).

Summary of actions:
- The feature branch 'feature/feature-30table-integration' was merged into 'develop'
- Feature branch 'feature/feature-30table-integration' has been removed
- You are now on branch 'develop'

 

 

 

 

 

이와 비슷한 과정으로 다양한 sub command가 존재한다.

 

$ git flow release start release-……

$ git flow hotfix start release-……

$ git flow support start release-……

Posted by '김용환'
,