Central repo (two main branches)
- origin/master : production-ready state
-
origin/dev : reflect the latest delivered development changes for the next release
merged back into master and tagged with a release number at a stable point (integration branch)
- initialize(create) master
git init
- create and checkout dev branch from master
git checkout -b dev master
- merge branch dev into master
git checkout master git merge --no-ff dev
Feature branch
May branch off from: develop
Must merge back into: develop
- non fast-forward(left) : merge commit 이 생성됨 (—no-ff 옵션 필수)
git merge --no-ff feature
- fast-forward(right) : 다른 커밋한 내용과 구분하기 힘듬
local branch 로 유지 후 삭제 또는 server 로 push 후 삭제
$ git checkout dev ## Switched to branch 'develop'
$ git merge --no-ff feature ## Updating ea1b82a..05e9557
## (Summary of changes)
$ git branch -d feature ## Deleted branch myfeature (was 05e9557).
$ git push origin dev
- create feature branch from dev
- merge branch feature/web1 into dev
git checkout dev
git merge --no-ff feature/web1
- create feature 2 branch from dev
- merge branch feature/web2 into dev
Reference
#dogfeet - A successful git branching model