[Git] Git Flow

# git flowパッケージの導入
% brew install git-flow

# リモートの更新
% git remote update

# developブランチの作成
% git branch develop

# git flowの導入
% git flow init
Which branch should be used for bringing forth production releases?
   - develop
   - feature-ph1-add-breadcrumb
   - feature-ph1-test
   - master
Branch name for production releases: [master]

Which branch should be used for integration of the "next release"?
   - develop
   - feature-ph1-add-breadcrumb
   - feature-ph1-test
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 config --list
gitflow.branch.master=master
gitflow.branch.develop=develop
gitflow.prefix.feature=feature/
gitflow.prefix.release=release/
gitflow.prefix.hotfix=hotfix/
gitflow.prefix.support=support/
gitflow.prefix.versiontag=

# 既存リポジトリをfeatureへ移動
% git branch -m feature-ph1-test feature/feature-ph1-test
% git checkout feature/feature-ph1-test
% git push origin feature/feature-ph1-test

ブランチの作成

$ git flow feature start {branch_name}
Switched to a new branch '{branch_name}'

Summary of actions:
- A new branch 'feature/{branch_name}' was created, based on 'develop'
- You are now on branch 'feature/{branch_name}'

Now, start committing on your feature. When done, use:

     git flow feature finish {branch_name}

ブランチの公開(push)

git flow feature publish {branch_name}
Counting objects: 702, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (424/424), done.
Writing objects: 100% (702/702), 15.56 MiB | 1.51 MiB/s, done.
Total 702 (delta 401), reused 218 (delta 185)
remote: Resolving deltas: 100% (401/401), completed with 280 local objects.
To https://github.com/xxx/xxx.git
 * [new branch]      feature/{branch_name} -> feature/{branch_name}
Already on 'feature/{branch_name}'
Your branch is up-to-date with 'origin/feature/{branch_name}'.

Summary of actions:
- A new remote branch 'feature/{branch_name}' was created
- The local branch 'feature/{branch_name}' was configured to track the remote branch
- You are now on branch 'feature/{branch_name}'

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です