まず git-flow のインストール。
$ brew install git-flow
master 以外のブランチがない場合は、develop 用のブランチを作っておいてから git flow init
するだけ。feature 用のブランチがある場合は、後で git branch -m bar feature/bar
とかすればいいのではないかと思います。
$ git branch develop
$ 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/]
Release branches? [release/]
Hotfix branches? [hotfix/]
Support branches? [support/]
Version tag prefix? []
$ git status
# On branch master
nothing to commit (working directory clean)
$ git branch
develop
* master
$ git flow feature
No feature branches exist.
You can start a new feature branch:
git flow feature start <name> [<base>]
$ git flow feature start foo
Switched to a new branch 'feature/foo'
Summary of actions:
- A new branch 'feature/foo' was created, based on 'develop'
- You are now on branch 'feature/foo'
Now, start committing on your feature. When done, use:
git flow feature finish foo
$ git branch
develop
* feature/foo
master