Successfully reported this slideshow.
Your SlideShare is downloading. ×

バージョン管理のワークフロー

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Loading in …3
×

Check these out next

1 of 24 Ad

More Related Content

Slideshows for you (20)

Recently uploaded (20)

Advertisement

バージョン管理のワークフロー

  1. 1. バージョン管理の ワークフロー Twitter ID: @add20 2012/3/10
  2. 2. A successful Git branching model A succcessful Git branching model とは、Git の開発モデルの内の一 つです。 Gitのブランチは自由に簡単に作ることができますが、自由度が 高いが故にかえってそれが混乱の元になることもあります。 このモデルに従ってバージョン管理をすることで、Gitによる バージョン管理のワークフローの見通しがよくなります。 また、他者と協力して開発するときにも共通の指針となり大変便 利です。
  3. 3. メインブランチ この開発モデルでは、中心となる二つの平行し たブランチを軸に開発を進めていきます。 master develop
  4. 4. masterブランチ masterブランチは、製品として出荷可能な状態を常に反映するブラン チです。ユーザはこのブランチの最新の安定板をcloneして使うことにな るでしょう。 masterブランチを、安定したリリースバージョン専用のブランチとし て使用することで、最新安定板ブランチの所在が明確になります。
  5. 5. developブランチ develoブランチは、次のリリースのための最新の開発作業の変更を常に反映するブ ランチです。 いわゆる開発版です。 developブランチは、各機能の統合ブランチとして使用します。このように決めてお くことで、機能ごとに作ったブランチの統合先を忘れたりすることがなくなり、ト ピックブランチのベースブランチを探す作業から解放されます。
  6. 6. メインブランチ 開発者は新しい機能をdevelopブランチにどんどん 追加して、developブランチが十分に安定してきた ら、masterブランチにマージしてリリースします。
  7. 7. サポートブランチ サポートブランチは、機能の追加、製品リリースの準備、製品に起き た問題の解決などの用途に使用されます。 Feature ブランチ Release ブランチ Hotfix ブランチ
  8. 8. Feature ブランチ フィーチャーブランチ(またはトピックブランチ とも言う)は、次のリリースや遠い将来に入るよ うな新しい機能の開発をするのに使われる。 分岐元:develop マージ先:develop
  9. 9. Feature ブランチ $ git checkout -b feature-A develop (feature-Aの実装が完了したら) $ git checkout develop $ git merge --no-ff feature-A $ git branch -d feature-A $ git push origin develop
  10. 10. Release ブランチ リリースブランチは新しい製品リリースの準備をサポートします。 リリースのためのメタデータ(バージョン番号、ビルド日時など) の準備をするためのブランチです。こういった細かい作業をリリー スブランチ内ですることによって、developブランチをきれいに保ち ます。 分岐元:develop マージ先:develop と master
  11. 11. Release ブランチ $ git checkout -b release-1.2 develop (バージョン番号の変更などをする) $ git checkout master $ git merge --no-ff release-1.2 $ git tag -a 1.2 $ git checkout develop $ git merge --no-ff release-1.2 $ git branch -d release-1.2
  12. 12. Hotfix ブランチ ホットフィックスブランチは、安定板のmasterで致 命的なバグが見つかったときなどに使用します。 ホットフィックスブランチの分岐元はmasterです。 その極意は、developブランチで作業しているチー ムメンバーが作業を続けられながら、別の人間が 製品の素早い修正を準備できることです。 分岐元:master マージ先:develop と master
  13. 13. Hotfix ブランチ $ git checkout -b hotfix-1.2.1 master (バージョン番号などの変更とバグフィックスをする) $ git commit -m “Fix a bug” $ git checkout master $ git merge --no-ff hotfix-1.2.1 $ git tag -a 1.2.1 $ git checkout develop $ git merge --no-ff hotfix-1.2.1 $ git branch -d hotfix-1.2.1
  14. 14. feature release branches develop branches hotfixes master Time Tag Severe Major bug fixed feature for Feature for next for productio future n: Incorporat e bugfix in Tag Start of release branch for 1.0 From this point on, “next release” means Only Bugfixes from rel. Tag branch may be continuously model l Git br anching uccessfu Author: Vincent Driessen Original blog post: http://nvie.com/ As
  15. 15. このブランチモデルは、 いいとは思うけど・・・
  16. 16. あんな長ったらしいフローは、 いちいち覚えていられないし・・・ 打つコマンドもたくさんあって ちょっと・・・
  17. 17. あるんです
  18. 18. git-flow git-flow A successful branching model を補助してく れるGitプラグイン
  19. 19. git-flowのインストール Macな方 $ /usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/ master/Library/Contributions/ install_homebrew.rb)" $ brew install git-flow
  20. 20. git-flowのインストール UbuntuまたはDebianな方 $ apt-get install git-flow 上記以外のLinuxの方 $ wget --no-check-certificate -q -O - https:// github.com/nvie/gitflow/raw/develop/ contrib/gitflow-installer.sh | sudo bash
  21. 21. git-flowの主なコマンド $ git flow init $ git flow feature start A $ git flow feature finish A $ git flow release start 1.2 $ git flow release finish 1.2 $ git flow hotfix start 1.2.1 $ git flow hotfix finish 1.2.1
  22. 22. 参考 参考というか、引用というか、コピペというか・・・ http://nvie.com/posts/a-successful-git-branching- model/ http://keijinsonyaban.blogspot.com/2010/10/ successful-git-branching-model.html http://www.oreilly.co.jp/community/blog/ 2011/11/branch-model-with-git-flow.html http://d.hatena.ne.jp/Voluntas/ 20101223/1293111549 https://github.com/nvie/gitflow
  23. 23. ご清聴ありがとうございました。

Editor's Notes

  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

×