레이블이 git-flow인 게시물을 표시합니다. 모든 게시물 표시
레이블이 git-flow인 게시물을 표시합니다. 모든 게시물 표시

git flow 사용하기

# git flow
# 설치 - mac
brew install git-flow-avh

# 설치 - ubuntu
apt-get install git-flow

# 초기화 (이미 gitflow 되어 있다면 skip)
# develop, master 브랜치가 이미 존재해야한다.
# 브랜치이름을 정하는 단계로 엔터쳐서 기본설정된 이름을 사용하자.
git flow init
Which branch should be used for bringing forth production releases?
   - develop
   - master
Branch name for production releases: [master]
Which branch should be used for integration of the "next release"?
   - develop
Branch name for "next release" development: [develop]
How to name your supporting branch prefixes?
Feature branches? [feature/]
Bugfix branches? [bugfix/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []
Hooks and filters directory? [/Users/ysoftman/workspace/gopath/ysoftman-test/.git/hooks]

# 기능 브랜치 생성
# (develop 기반으로) 로컬에 feature/ysoftman-1 브랜치 생성하고 브랜치 전환
git flow feature start ysoftman-1

# 기능 브랜치 publish
# remote 에 feature/ysoftman-1 푸시
# feature 에서 작업하면서 커밋 및 푸시로 remote 에 브랜치를 생성한다.
git flow feature publish ysoftman-1

# 기능 브랜치 완료
# develop 에 머지하고, feature/ysoftman-1 삭제하고, develop 브랜치로 전환
git flow feature finish ysoftman-1

# 릴리즈 브랜치 생성
# (develop 기반으로) 로컬에 release/ysoftman-release-1 브랜치 생성하고 브랜치 전환
git flow release start ysoftman-release-1

# 릴리즈 브랜치 publish
# remote 에 release/ysoftman-release-1 푸시
git flow release publish ysoftman-release-1

# 릴리즈 브랜치 완료
# develop, master 에 머지하고, release/ysoftman-release-1 삭제
# (커밋 메시지 작성화면 저장하면 태그 메시지 작성화면이 나온다.)
git flow release finish ysoftman-release-1

# 릴리즈 브랜치 완료 후에는 태그(ysoftman-release-1포함) 및 master 푸시해야 한다.
git push --tags
git checkout master
git push

# 핫픽스 시작
# (master 기반으로) hotfix/ysoftman-hotfix-1 브랜치 생성하고 브랜치 전환
git flow hotfix start ysoftman-hotfix-1

# 핫픽스 내용 수정 후 커밋
git ci -a

# 핫픽스 완료
# develop, master 에 핫픽스 내용 머지되고 hotfix/ysoftman-hotfix-1 삭제
git flow hotfix finish ysoftman-hotfix-1

# 태그 포함 develop, master 푸시
git push --tags
git checkout develop && git push
git checkout master && git push