ETC
Git flow
천재보단범재
2021. 10. 27. 22:20
이 글은 'A successful Git branching model'을 해석, 정리한 글입니다.
The main branches
master
- origin/master, HEAD
- Product Release 하기 위한 branch
- Release History 관리 -> tagged with a release number
develop
- origin/develop, HEAD
- reflect a state with the lastest deliverd development changes for the next release
- 안정적인 상태 유지
Supporting branches
Feature branches
- 새로운 기능 개발 -> for the upcoming or distant future release
- develop branch에서 feature branch 생성
- 개발 완료 후 develop branch로 merge
# creating a feature branch
> git checkout -b myfeature develop
# Incorpating a finished feature on develop
> git checkout develop
> git merge --no-ff myfeature # --no-ff -> new commit object
> git branch -d myfeature
> git push origin develop
Release branches
- preparation of a new production release
- minor bug fix
- preparing meta-data for a release(version number, build date, etc.)
- develop branch에서 생성
- 개발 완료 후 develop or master branch로 merge
# creating a release branch
> git checkout -b release-1.2 develop
> ./bump-version.sh 1.2
> git commit -a -m "Bumped version number to 1.2"
# finshing a release branch
> git checkout master
> git merge --no-ff release-1.2
> git tag -a 1.2
# sync master develop
> git checkout develop
> git merge --no-ff release-1.2
Hotfix branches
- 제품 Critical Bug가 발생하여 즉시 해결해야될 경우 생성
- mater branch에서 생성
- Bug 수정 후 develop와 master로 merge
# creating the hotfix branch
> git checkout -b hotfix-1.2.1 master
> ./bump-version.sh 1.2.1
> git commit -a -m "Bumped version number to 1.2.1"
> git commit -m "Fixed serve production problem"
# finishing a hotfix branch
> gait checkout master
> git merge --no-ff hotfix-1.2.1
> git tag -a 1.2.1
728x90
반응형