Skip to content
Dongwook Lee edited this page Mar 18, 2013 · 2 revisions

2013-03-07

git flow

practice

  1. 실습 dir 생성 및 초기 커밋
    • mkdir git-flow-test; cd git-flow-test; git init
    • echo "fist" >> product.txt
    • git add .
    • git commit -m "first commit"
  2. git flow init
    • git flow 시작
  3. 두번째 커밋
    • echo "second" >> product.txt
    • git commit -am "second commit"
  4. feature-01 작성
    • git flow feature start feature-01
    • echo "feature-01" >> product.txt
    • git commit -am "feature-01 added"
  5. feature-01 마무리 안하고 feature-02 작성
    • git flow feature start feature-02
    • cat product.txt
      • feature는 development 에서 파생됨
    • echo "feature-02:1" >> product.txt
    • git commit -am "feature-02:1 added"
    • echo "feature-02:2" >> product.txt
    • git commit -am "feature-02:2 added"
  6. git flow feature finish feature-01
    • feature branch 삭제됐음을 확인
  7. git flow feature finish feature-02
  8. merge conflict
    • git add .; git commit
  9. git flow feature finish feature-02
  10. release
    • develop 브랜치에서 파생
    • release 작업 브랜치이다
    • git flow release start 1.0
    • echo "release 1.0" >> RELEASE
    • git add RELEASE
    • git commit -m "release note added"
    • git flow release finish 1.0
  11. release finish 후
    • 출력 메시지의 Summary of actions:를 살펴본다
    • release: git graph
      • 출발은 developmment 에서 분리된 branch
      • master 브랜치와 머지
      • developemnt 브랜치와 merge
  12. hotfix 처리하기
    • git flow feature start feature-03
    • echo "feature-03:1" >> product.txt
    • git add product.txt
    • git commit -m "feature-03:1 added"
    • 출시된 프로그램에서 문제 발견!
  13. git flow hotfix start hotfix-01
    • cat product.txt
      • hotfix는 master 브랜치에서 생성됨
    • echo "hotfix-01 patched" >> product.txt
    • git commit -am "hotfix-01 patched"
  14. hotfix finish 후
    • 출력 메시지의 Summary of actions:를 살펴본다.
    • 역시 development 브랜치에 back-merge(master > dev)된다
  15. feature-03 계속 작업하기
    • git branch로 현재 브랜치 확인(development)
    • git checkout feature/feature-03
    • echo "feature-03:2" >> product.txt
    • git commit -am "feature-03:2 added"
  16. hotfix(development)를 현재 작업에 반영
    • git flow feature rebase
      • 늘 강조했듯이, rebase 도중 conflict 처리한 후에는 add만하고 git rebase --continue 한다.
    • git graph 등으로 모양 확인 후 rebase 결과를 분석해 보자