SlideShare a Scribd company logo
1 of 44
Git - 運用編

2012/05/14, DT Corp
 Naomichi Yamakita
概要


-   DTにおけるGitの基本開発サイクル

    1. 開発者はoriginからリポジトリのクローンを作成

    2. 各自の開発環境で開発を進め、変更内容をテストサーバに反映する

    3. テスト環境で動作確認

    4. ステージング環境にデプロイ

    5. プロダクション環境にデプロイ

    6. リリース完了

-   気軽にブランチを切れるため、ルールを決めないと混乱の元となる
運用ポリシー 1/2


-       開発リポジトリでは、仕様書や各種ドキュメント(議事録、見積書、デー
        タファイル等)を管理しない

    -    Redmine+Google Appsで一元管理

-       ファイル名は英語に統一する

    -    日本語ファイル名は、MacやLinux環境下で動作が不安定なため

    -    デベロッパーポータル: 基本原則: ファイルとディレクトリ
         http://project.svc-service.net/guideline/
         base_guideline.html#file_rule

-       Gitでは原則的にソースファイル(及び付随するAPI)のみを管理する
運用ポリシー 2/2


-   コミットメッセージに変更内容の概要を記す

-   コミット時に開発関係者へログメールが自動送信される

-   リポジトリの作成方法(DT社員のみ)

     $ cd /usr/local/git/repositories/
     $ su git
     $ git init --bare --shared=true {repository_name}.git
     Initialized empty shared Git repository in /usr/local/git/
     repositories/{repository_name}.git/

     $   cd ../gitosis-admin/
     $   vi gitosis.conf
     $   git commit -m “add {repository_name” -a
     $   git push
運用ポリシー 2/2


-   コミットメッセージに変更内容の概要を記す

-   コミット時に開発関係者へログメールが自動送信される

-   リポジトリの作成方法(DT社員のみ)

     $ cd /usr/local/git/repositories/
     $ su git
     $ git init --bare --shared=true {repository_name}.git
     Initialized empty shared Git repository in /usr/local/git/
     repositories/{repository_name}.git/
                                                共有リポジトリの設定
     $ cd ../gitosis-admin/
     $ vi gitosis.conf
     $ git commit -m “add {repository_name” -a
     $ git push
運用ポリシー 2/2


-   コミットメッセージに変更内容の概要を記す

-   コミット時に開発関係者へログメールが自動送信される

-   リポジトリの作成方法(DT社員のみ)

     $ cd /usr/local/git/repositories/
     $ su git
     $ git init --bare --shared=true {repository_name}.git
     Initialized empty shared Git repository in /usr/local/git/
     repositories/{repository_name}.git/
                                                共有リポジトリの設定
     $ cd ../gitosis-admin/
     $ vi gitosis.conf
     $ git commit -m “add {repository_name” -a
     $ git push
                         リポジトリのパーミッションを設定
DTが採用するGitの開発モデル


-       A successful Git branching model

    -        原文

         -    http://nvie.com/posts/a-successful-git-branching-model/

    -        日本語訳

         -    http://keijinsonyaban.blogspot.jp/2010/10/successful-git-
              branching-model.html
ブランチの種類


-       ブランチの種類

    -        メインブランチ

         -    master

         -    develop

    -        サポートブランチ

         -    feature

         -    release

         -    hotfix
メインブランチとは


-   中央リポジトリに存在し、削除されることなく永続的に保持される
ブランチの説明に入る前に


-   資料内でオレンジ色で書かれた内容はDT独自のローカルルールです
メインブランチの種類


-       master

    -        常にリリース可能状態

    -        開発では使用しない、タグ付け専用のブランチ

-       develop

    -        開発用途のブランチ

    -        開発完了後はmasterブランチへマージ

         -    この際にmasterブランチ上でタグ付けを行う
featureブランチとは


-       developとは別に並行開発をサポートするブランチを指す

    -    ここでの「並行開発」は、将来的に実装予定の機能やホットフィックス
         を含む

-       メインブランチと異なり、目的を達した後はブランチ自体破棄される

-       (原則的には)originサーバに存在しない
featureブランチの種類 1/3


-       fuature

    -         実験段階の機能を開発する際に使用する

    -         ブランチ特性

          -        分岐元: develop

          -        マージ先: develop

               -     場合によってはマージされず破棄されることもありうる

          -        ブランチ名の規則: fuature/{ticket_id}

               -     {ticket_id}: 対応するRedmineのチケットID
featureブランチの種類 2/3


-       release

    -         新しい機能をリリースする直前に使用する

    -         マイナーバグフィックスや最終調整はreleaseブランチで行う

    -         ブランチ特性

          -        分岐元: develop

          -        マージ先: developとmaster

               -     masterにマージする際はタグを付ける

          -        ブランチ名の規則: release/{yyyymmdd}
featureブランチの種類 3/3


-       hotfix

    -        リリース済みの製品におけるクリティカルなバグを修正する

         -        developブランチは他の機能を開発中で不安定な可能性がある

    -        ブランチ特性

         -        分岐元: master

         -        マージ先: developとmaster

              -     masterにマージする際はタグを付ける

              -     releaseが存在する場合はdevelopの代わりにreleaseにマージ

         -        ブランチ名の規則: hotfix/{yyyymmdd}_{ticket_id}
git-flow


-       A successful Git branching model のモデルを運用しやすくするプラグ
        イン

    -     https://github.com/nvie/gitflow

-       git-flowのセットアップ(Windows/Linux/Mac)

    -     http://www.oreilly.co.jp/community/blog/2011/11/branch-model-
          with-git-flow.html
git-flowの実行


-   リポジトリとブランチを作成する


     $ git flow init
     Initialized empty Git repository in /Users/naomichi/Desktop/
     testrep/.git/
     No branches exist yet. Base branches must be created now.
     Branch name for production releases: [master]
     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 branch -a
     * develop
       master
git-flowの実行


-   リポジトリとブランチを作成する


     $ git flow init
     Initialized empty Git repository in /Users/naomichi/Desktop/
     testrep/.git/
     No branches exist yet. Base branches must be created now.
     Branch name for production releases: [master]
     Branch name for "next release" development: [develop]
                                          masterブランチ、featureブランチを命名
     How to name your supporting branch prefixes?
     Feature branches? [feature/]
     Release branches? [release/]
     Hotfix branches? [hotfix/]
     Support branches? [support/]
     Version tag prefix? []

     $ git branch -a
     * develop
       master
git-flowの実行


-   リポジトリとブランチを作成する


     $ git flow init
     Initialized empty Git repository in /Users/naomichi/Desktop/
     testrep/.git/
     No branches exist yet. Base branches must be created now.
     Branch name for production releases: [master]
     Branch name for "next release" development: [develop]
                                          masterブランチ、featureブランチを命名
     How to name your supporting branch prefixes?
     Feature branches? [feature/]
     Release branches? [release/]
     Hotfix branches? [hotfix/]
     Support branches? [support/]
     Version tag prefix? []

     $ git branch -a
     * develop
       master
                       featureブランチは表示されない(後述)
featureブランチの作成 1/2


-   新機能の開発を開始する


     $ echo 'hello' > greeting
     $ git add .
     $ git commit -m "first commit"

     $ git flow feature start 100
     Switched to a new branch 'feature/100'

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

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

          git flow feature finish 100

     $ git branch
       develop
     * feature/100
       master
featureブランチの作成 1/2


-   新機能の開発を開始する


     $ echo 'hello' > greeting           Redmine#100の開発を開始
     $ git add .
     $ git commit -m "first commit"

     $ git flow feature start 100
     Switched to a new branch 'feature/100'

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

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

          git flow feature finish 100

     $ git branch
       develop
     * feature/100
       master
featureブランチの作成 1/2


-   新機能の開発を開始する


     $ echo 'hello' > greeting           Redmine#100の開発を開始
     $ git add .
     $ git commit -m "first commit"

     $ git flow feature start 100
     Switched to a new branch 'feature/100'

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

     Now, start committing on your feature. When done, use:
                                     developブランチを元にfeatureブランチが作成された
          git flow feature finish 100

     $ git branch
       develop
     * feature/100
       master
featureブランチの作成 1/2


-   新機能の開発を開始する


     $ echo 'hello' > greeting           Redmine#100の開発を開始
     $ git add .
     $ git commit -m "first commit"

     $ git flow feature start 100
     Switched to a new branch 'feature/100'

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

     Now, start committing on your feature. When done, use:
                                     developブランチを元にfeatureブランチが作成された
          git flow feature finish 100

     $ git branch
       develop
     * feature/100
       master
                      ブランチが追加される
featureブランチの作成 2/2


-   featureの開発を終わらせてdevelopに戻る(マージする)


     $ echo 'good night' > greeting
     $ git commit -m "second commit" -a

     $ git flow feature finish 100
     Switched to branch 'develop'
     Updating 01f0874..58f1c0d
     Fast-forward
      greeting |    2 +-
      1 files changed, 1 insertions(+), 1 deletions(-)
     Deleted branch feature/100 (was 58f1c0d).

     Summary of actions:
     - The feature branch 'feature/100' was merged into 'develop'
     - Feature branch 'feature/100' has been removed
     - You are now on branch 'develop'

     $ cat greeting
     good night

     $ git branch
     * develop
       master
featureブランチの作成 2/2


-   featureの開発を終わらせてdevelopに戻る(マージする)

                                      featureブランチの終わりを宣言
     $ echo 'good night' > greeting
     $ git commit -m "second commit" -a

     $ git flow feature finish 100
     Switched to branch 'develop'
     Updating 01f0874..58f1c0d
     Fast-forward
      greeting |    2 +-
      1 files changed, 1 insertions(+), 1 deletions(-)
     Deleted branch feature/100 (was 58f1c0d).

     Summary of actions:
     - The feature branch 'feature/100' was merged into 'develop'
     - Feature branch 'feature/100' has been removed
     - You are now on branch 'develop'

     $ cat greeting
     good night

     $ git branch
     * develop
       master
featureブランチの作成 2/2


-   featureの開発を終わらせてdevelopに戻る(マージする)

                                      featureブランチの終わりを宣言
     $ echo 'good night' > greeting
     $ git commit -m "second commit" -a

     $ git flow feature finish 100
     Switched to branch 'develop'
     Updating 01f0874..58f1c0d
     Fast-forward
      greeting |    2 +-   developブランチにマージされ、featureブランチが削除される
      1 files changed, 1 insertions(+), 1 deletions(-)
     Deleted branch feature/100 (was 58f1c0d).

     Summary of actions:
     - The feature branch 'feature/100' was merged into 'develop'
     - Feature branch 'feature/100' has been removed
     - You are now on branch 'develop'

     $ cat greeting
     good night

     $ git branch
     * develop
       master
featureブランチの作成 2/2


-   featureの開発を終わらせてdevelopに戻る(マージする)

                                      featureブランチの終わりを宣言
     $ echo 'good night' > greeting
     $ git commit -m "second commit" -a

     $ git flow feature finish 100
     Switched to branch 'develop'
     Updating 01f0874..58f1c0d
     Fast-forward
      greeting |    2 +-   developブランチにマージされ、featureブランチが削除される
      1 files changed, 1 insertions(+), 1 deletions(-)
     Deleted branch feature/100 (was 58f1c0d).

     Summary of actions:
     - The feature branch 'feature/100' was merged into 'develop'
     - Feature branch 'feature/100' has been removed
     - You are now on branch 'develop'

     $ cat greeting
     good night         developブランチにマージされたことが確認できる

     $ git branch
     * develop
       master
featureブランチの作成 2/2


-   featureの開発を終わらせてdevelopに戻る(マージする)

                                      featureブランチの終わりを宣言
     $ echo 'good night' > greeting
     $ git commit -m "second commit" -a

     $ git flow feature finish 100
     Switched to branch 'develop'
     Updating 01f0874..58f1c0d
     Fast-forward
      greeting |    2 +-   developブランチにマージされ、featureブランチが削除される
      1 files changed, 1 insertions(+), 1 deletions(-)
     Deleted branch feature/100 (was 58f1c0d).

     Summary of actions:
     - The feature branch 'feature/100' was merged into 'develop'
     - Feature branch 'feature/100' has been removed
     - You are now on branch 'develop'

     $ cat greeting
     good night         developブランチにマージされたことが確認できる

     $ git branch
     * develop          featureブランチは削除済み
       master
releaseブランチの作成 1/2


-   リリースバージョンを作成

     $ git flow release start 20120401
     Switched to a new branch 'release/20120401'

     Summary of actions:
     - A new branch 'release/20120401' was created, based on
     'develop'
     - You are now on branch 'release/20120401'

     Follow-up actions:
     - Bump the version number now!
     - Start committing last-minute fixes in preparing your release
     - When done, run:

          git flow release finish '20120401'

     $ git branch
       develop
       master
     * release/20120401
releaseブランチの作成 1/2


-   リリースバージョンを作成

     $ git flow release start 20120401              releaseブランチを開始
     Switched to a new branch 'release/20120401'

     Summary of actions:
     - A new branch 'release/20120401' was created, based on
     'develop'
     - You are now on branch 'release/20120401'

     Follow-up actions:
     - Bump the version number now!
     - Start committing last-minute fixes in preparing your release
     - When done, run:

          git flow release finish '20120401'

     $ git branch
       develop
       master
     * release/20120401
releaseブランチの作成 1/2


-   リリースバージョンを作成

     $ git flow release start 20120401              releaseブランチを開始
     Switched to a new branch 'release/20120401'

     Summary of actions:
     - A new branch 'release/20120401' was created, based on
     'develop'
     - You are now on branch 'release/20120401'

     Follow-up actions:
     - Bump the version number now! developブランチを元にreleaseブランチが作成された
     - Start committing last-minute fixes in preparing your release
     - When done, run:

          git flow release finish '20120401'

     $ git branch
       develop
       master
     * release/20120401
releaseブランチの作成 1/2


-   リリースバージョンを作成

     $ git flow release start 20120401              releaseブランチを開始
     Switched to a new branch 'release/20120401'

     Summary of actions:
     - A new branch 'release/20120401' was created, based on
     'develop'
     - You are now on branch 'release/20120401'

     Follow-up actions:
     - Bump the version number now! developブランチを元にreleaseブランチが作成された
     - Start committing last-minute fixes in preparing your release
     - When done, run:

          git flow release finish '20120401'

     $ git branch
       develop              releaseブランチがアクティブになる
       master
     * release/20120401
releaseブランチの作成 2/2


-   プログラムの微調整を加えた後にリリースを行う

     $ echo 'good mornink'
     good mornink
     $ git commit -m "first commit"

     $ git flow release finish 1.0
     Switched to branch 'master'
     Merge made by recursive.
      greeting |    1 +
      1 files changed, 1 insertions(+), 0 deletions(-)
      create mode 100644 greeting
      create mode 100644 hello
      Deleted branch release/1.0 (was 58f1c0d).

     Summary of actions:
     - Latest objects have been fetched from 'origin'
     - Release branch has been merged into 'master'
     - The release was tagged '1.0'
     - Release branch has been back-merged into 'develop'
     - Release branch 'release/1.0' has been deleted

     [naomichi: test]$ git tag
     20120401
releaseブランチの作成 2/2


-   プログラムの微調整を加えた後にリリースを行う

     $ echo 'good mornink'
     good mornink
     $ git commit -m "first commit"

     $ git flow release finish 1.0
     Switched to branch 'master'
     Merge made by recursive.
      greeting |    1 +
      1 files changed, 1 insertions(+), 0 deletions(-)
      create mode 100644 greeting
                          releaseブランチを終了し、master/developブランチにマージする
      create mode 100644 hello
      Deleted branch release/1.0 (was 58f1c0d).

     Summary of actions:
     - Latest objects have been fetched from 'origin'
     - Release branch has been merged into 'master'
     - The release was tagged '1.0'
     - Release branch has been back-merged into 'develop'
     - Release branch 'release/1.0' has been deleted

     [naomichi: test]$ git tag
     20120401
releaseブランチの作成 2/2


-   プログラムの微調整を加えた後にリリースを行う

     $ echo 'good mornink'
     good mornink
     $ git commit -m "first commit"

     $ git flow release finish 1.0
     Switched to branch 'master'
     Merge made by recursive.
      greeting |    1 +
      1 files changed, 1 insertions(+), 0 deletions(-)
      create mode 100644 greeting
                          releaseブランチを終了し、master/developブランチにマージする
      create mode 100644 hello
      Deleted branch release/1.0 (was 58f1c0d).

     Summary of actions:
     - Latest objects have been fetched from 'origin'
     - Release branch has been merged into 'master'
     - The release was tagged '1.0'
     - Release branch has been back-merged into 'develop'
     - Release branch 'release/1.0' has been deleted

     [naomichi: test]$ git tag
     20120401              マージとmasterブランチへのタグ付けが行われた
hotfixブランチの作成 1/2


-   リリース済みのプログラムに対し修正を加える


     $ git flow hotfix start 20120401_200
     Switched to a new branch 'hotfix/20120401_200'

     Summary of actions:
     - A new branch 'hotfix/20120401_200' was created, based on
     'master'
     - You are now on branch 'hotfix/20120401_200'

     Follow-up actions:
     - Bump the version number now!
     - Start committing your hot fixes
     - When done, run:

          git flow hotfix finish '20120401_200'

     $ git branch
       develop
     * hotfix/20120401_200
       master
hotfixブランチの作成 1/2


-   リリース済みのプログラムに対し修正を加える
                                                  Redmine#200のホットフィックスを開始


     $ git flow hotfix start 20120401_200
     Switched to a new branch 'hotfix/20120401_200'

     Summary of actions:
     - A new branch 'hotfix/20120401_200' was created, based on
     'master'
     - You are now on branch 'hotfix/20120401_200'

     Follow-up actions:
     - Bump the version number now!
     - Start committing your hot fixes
     - When done, run:

          git flow hotfix finish '20120401_200'

     $ git branch
       develop
     * hotfix/20120401_200
       master
hotfixブランチの作成 1/2


-   リリース済みのプログラムに対し修正を加える
                                                  Redmine#200のホットフィックスを開始


     $ git flow hotfix start 20120401_200
     Switched to a new branch 'hotfix/20120401_200'

     Summary of actions:
     - A new branch 'hotfix/20120401_200' was created, based on
     'master'
     - You are now on branch 'hotfix/20120401_200'

     Follow-up actions:
     - Bump the version number now!    masterブランチを元にhotfixブランチを作成
     - Start committing your hot fixes
     - When done, run:

          git flow hotfix finish '20120401_200'

     $ git branch
       develop
     * hotfix/20120401_200
       master
hotfixブランチの作成 1/2


-   リリース済みのプログラムに対し修正を加える
                                                  Redmine#200のホットフィックスを開始


     $ git flow hotfix start 20120401_200
     Switched to a new branch 'hotfix/20120401_200'

     Summary of actions:
     - A new branch 'hotfix/20120401_200' was created, based on
     'master'
     - You are now on branch 'hotfix/20120401_200'

     Follow-up actions:
     - Bump the version number now!    masterブランチを元にhotfixブランチを作成
     - Start committing your hot fixes
     - When done, run:

          git flow hotfix finish '20120401_200'

     $ git branch
       develop                 hotfixブランチが追加される
     * hotfix/20120401_200
       master
hotfixブランチの作成 2/2


-   ホットフィックスの適用


     $ echo 'good night' > greeting
     $ git commit -m "fixed spell" -a
     # On branch hotfix/20120401_200
     nothing to commit (working directory clean)

     $ git flow hotfix finish 20120401_200
     Switched to branch 'develop'
     Already up-to-date!
     Merge made by recursive.
     Deleted branch hotfix/20120401_200 (was 8aeddfd).

     Summary of actions:
     - Latest objects have been fetched from 'origin'
     - Hotfix branch has been merged into 'master'
     - The hotfix was tagged '20120401_200'
     - Hotfix branch has been back-merged into 'develop'
     - Hotfix branch 'hotfix/20120401_200' has been deleted
hotfixブランチの作成 2/2


-   ホットフィックスの適用


     $ echo 'good night' > greeting
     $ git commit -m "fixed spell" -a
     # On branch hotfix/20120401_200   スペルミスを修正してコミット
     nothing to commit (working directory clean)

     $ git flow hotfix finish 20120401_200
     Switched to branch 'develop'
     Already up-to-date!
     Merge made by recursive.
     Deleted branch hotfix/20120401_200 (was 8aeddfd).

     Summary of actions:
     - Latest objects have been fetched from 'origin'
     - Hotfix branch has been merged into 'master'
     - The hotfix was tagged '20120401_200'
     - Hotfix branch has been back-merged into 'develop'
     - Hotfix branch 'hotfix/20120401_200' has been deleted
hotfixブランチの作成 2/2


-   ホットフィックスの適用


     $ echo 'good night' > greeting
     $ git commit -m "fixed spell" -a
     # On branch hotfix/20120401_200   スペルミスを修正してコミット
     nothing to commit (working directory clean)

     $ git flow hotfix finish 20120401_200
     Switched to branch 'develop'
     Already up-to-date!
     Merge made by recursive.        ホットフィックスを終わらせる
     Deleted branch hotfix/20120401_200 (was 8aeddfd).

     Summary of actions:
     - Latest objects have been fetched from 'origin'
     - Hotfix branch has been merged into 'master'
     - The hotfix was tagged '20120401_200'
     - Hotfix branch has been back-merged into 'develop'
     - Hotfix branch 'hotfix/20120401_200' has been deleted
hotfixブランチの作成 2/2


-   ホットフィックスの適用


     $ echo 'good night' > greeting
     $ git commit -m "fixed spell" -a
     # On branch hotfix/20120401_200   スペルミスを修正してコミット
     nothing to commit (working directory clean)

     $ git flow hotfix finish 20120401_200
     Switched to branch 'develop'
     Already up-to-date!
     Merge made by recursive.        ホットフィックスを終わらせる
     Deleted branch hotfix/20120401_200 (was 8aeddfd).

     Summary of actions:
     - Latest objects have been fetched from 'origin'
     - Hotfix branch has been merged into 'master'
     - The hotfix was tagged '20120401_200'
     - Hotfix branch has been back-merged into 'develop'
     - Hotfix branch 'hotfix/20120401_200' has been deleted


                               ホットフィックスをmaster/developブランチに反映
今後の運用方針案


-       コミット時にRedmineのチケットIDを必須とする

    -    変更内容とチケットを紐付けることで、変更の流れが掴みやすくなる

-       コミットフックでPHPのシンタックスチェック

More Related Content

What's hot

オンプレでPrivate Registry使ったDockerイメージの運用について
オンプレでPrivate Registry使ったDockerイメージの運用についてオンプレでPrivate Registry使ったDockerイメージの運用について
オンプレでPrivate Registry使ったDockerイメージの運用についてYASUKAZU NAGATOMI
 
Appsody でnodejsのアプリを立ち上げよう!
Appsody でnodejsのアプリを立ち上げよう!Appsody でnodejsのアプリを立ち上げよう!
Appsody でnodejsのアプリを立ち上げよう!Daisuke Hiraoka
 
家に帰るまでが遠足です
家に帰るまでが遠足です家に帰るまでが遠足です
家に帰るまでが遠足ですCryolite
 
アプリ屋もDockerをドカドカ使おう ~ Docker入門
アプリ屋もDockerをドカドカ使おう ~ Docker入門アプリ屋もDockerをドカドカ使おう ~ Docker入門
アプリ屋もDockerをドカドカ使おう ~ Docker入門Hori Tasuku
 
15分でCakePHPを始める方法(Nseg 2013-11-09 )
15分でCakePHPを始める方法(Nseg 2013-11-09 )15分でCakePHPを始める方法(Nseg 2013-11-09 )
15分でCakePHPを始める方法(Nseg 2013-11-09 )hiro345
 
はてなにおける継続的デプロイメントの現状と Docker の導入
はてなにおける継続的デプロイメントの現状と Docker の導入はてなにおける継続的デプロイメントの現状と Docker の導入
はてなにおける継続的デプロイメントの現状と Docker の導入Yu Nobuoka
 
omoon.org の裏側 〜FuelPHP の task 活用例〜
omoon.org の裏側 〜FuelPHP の task 活用例〜omoon.org の裏側 〜FuelPHP の task 活用例〜
omoon.org の裏側 〜FuelPHP の task 活用例〜Sotaro Omura
 
Redmineを快適に使うためのおすすめ初期設定
Redmineを快適に使うためのおすすめ初期設定Redmineを快適に使うためのおすすめ初期設定
Redmineを快適に使うためのおすすめ初期設定Go Maeda
 
Android起動周りのノウハウ
Android起動周りのノウハウAndroid起動周りのノウハウ
Android起動周りのノウハウchancelab
 
DockerとDocker Hubの操作と概念
DockerとDocker Hubの操作と概念DockerとDocker Hubの操作と概念
DockerとDocker Hubの操作と概念Masahito Zembutsu
 
Dockerイメージの理解とコンテナのライフサイクル
Dockerイメージの理解とコンテナのライフサイクルDockerイメージの理解とコンテナのライフサイクル
Dockerイメージの理解とコンテナのライフサイクルMasahito Zembutsu
 
Docker入門: コンテナ型仮想化技術の仕組みと使い方
Docker入門: コンテナ型仮想化技術の仕組みと使い方Docker入門: コンテナ型仮想化技術の仕組みと使い方
Docker入門: コンテナ型仮想化技術の仕組みと使い方Yuichi Ito
 
Dockerハンズオン
DockerハンズオンDockerハンズオン
DockerハンズオンKazuyuki Mori
 
Ansible quickstart
Ansible quickstartAnsible quickstart
Ansible quickstartHideki Saito
 
捕鯨!詳解docker
捕鯨!詳解docker捕鯨!詳解docker
捕鯨!詳解docker雄哉 吉田
 
Docker実践入門
Docker実践入門Docker実践入門
Docker実践入門hiro nemu
 
はじめてのコンテナーDocker & Windows & Linux
はじめてのコンテナーDocker & Windows & LinuxはじめてのコンテナーDocker & Windows & Linux
はじめてのコンテナーDocker & Windows & LinuxKazushi Kamegawa
 

What's hot (20)

Cross Platform Make
Cross Platform MakeCross Platform Make
Cross Platform Make
 
オンプレでPrivate Registry使ったDockerイメージの運用について
オンプレでPrivate Registry使ったDockerイメージの運用についてオンプレでPrivate Registry使ったDockerイメージの運用について
オンプレでPrivate Registry使ったDockerイメージの運用について
 
Appsody でnodejsのアプリを立ち上げよう!
Appsody でnodejsのアプリを立ち上げよう!Appsody でnodejsのアプリを立ち上げよう!
Appsody でnodejsのアプリを立ち上げよう!
 
家に帰るまでが遠足です
家に帰るまでが遠足です家に帰るまでが遠足です
家に帰るまでが遠足です
 
アプリ屋もDockerをドカドカ使おう ~ Docker入門
アプリ屋もDockerをドカドカ使おう ~ Docker入門アプリ屋もDockerをドカドカ使おう ~ Docker入門
アプリ屋もDockerをドカドカ使おう ~ Docker入門
 
15分でCakePHPを始める方法(Nseg 2013-11-09 )
15分でCakePHPを始める方法(Nseg 2013-11-09 )15分でCakePHPを始める方法(Nseg 2013-11-09 )
15分でCakePHPを始める方法(Nseg 2013-11-09 )
 
はてなにおける継続的デプロイメントの現状と Docker の導入
はてなにおける継続的デプロイメントの現状と Docker の導入はてなにおける継続的デプロイメントの現状と Docker の導入
はてなにおける継続的デプロイメントの現状と Docker の導入
 
omoon.org の裏側 〜FuelPHP の task 活用例〜
omoon.org の裏側 〜FuelPHP の task 活用例〜omoon.org の裏側 〜FuelPHP の task 活用例〜
omoon.org の裏側 〜FuelPHP の task 活用例〜
 
Redmineを快適に使うためのおすすめ初期設定
Redmineを快適に使うためのおすすめ初期設定Redmineを快適に使うためのおすすめ初期設定
Redmineを快適に使うためのおすすめ初期設定
 
Android起動周りのノウハウ
Android起動周りのノウハウAndroid起動周りのノウハウ
Android起動周りのノウハウ
 
DockerとDocker Hubの操作と概念
DockerとDocker Hubの操作と概念DockerとDocker Hubの操作と概念
DockerとDocker Hubの操作と概念
 
Dockerイメージの理解とコンテナのライフサイクル
Dockerイメージの理解とコンテナのライフサイクルDockerイメージの理解とコンテナのライフサイクル
Dockerイメージの理解とコンテナのライフサイクル
 
Docker入門: コンテナ型仮想化技術の仕組みと使い方
Docker入門: コンテナ型仮想化技術の仕組みと使い方Docker入門: コンテナ型仮想化技術の仕組みと使い方
Docker入門: コンテナ型仮想化技術の仕組みと使い方
 
Dockerハンズオン
DockerハンズオンDockerハンズオン
Dockerハンズオン
 
AndroidとSELinux
AndroidとSELinuxAndroidとSELinux
AndroidとSELinux
 
Ansible quickstart
Ansible quickstartAnsible quickstart
Ansible quickstart
 
捕鯨!詳解docker
捕鯨!詳解docker捕鯨!詳解docker
捕鯨!詳解docker
 
Docker実践入門
Docker実践入門Docker実践入門
Docker実践入門
 
はじめてのコンテナーDocker & Windows & Linux
はじめてのコンテナーDocker & Windows & LinuxはじめてのコンテナーDocker & Windows & Linux
はじめてのコンテナーDocker & Windows & Linux
 
Docker社内勉強会
Docker社内勉強会Docker社内勉強会
Docker社内勉強会
 

Similar to Git (運用編)

Gitのよく使うコマンド
Gitのよく使うコマンドGitのよく使うコマンド
Gitのよく使うコマンドYUKI Kaoru
 
Git-dojo In Sendagaya.rb
Git-dojo In Sendagaya.rbGit-dojo In Sendagaya.rb
Git-dojo In Sendagaya.rbJun Fukaya
 
git 初めの一歩
git 初めの一歩git 初めの一歩
git 初めの一歩Shin Yoshida
 
RedmineとGitとスクラム
RedmineとGitとスクラムRedmineとGitとスクラム
RedmineとGitとスクラムTakashi Okamoto
 
今さら聞けない人のためのGit超入門 GitLab 14対応版
今さら聞けない人のためのGit超入門 GitLab 14対応版今さら聞けない人のためのGit超入門 GitLab 14対応版
今さら聞けない人のためのGit超入門 GitLab 14対応版VirtualTech Japan Inc./Begi.net Inc.
 
sbtマルチプロジェクトビルドの使いどころ
sbtマルチプロジェクトビルドの使いどころsbtマルチプロジェクトビルドの使いどころ
sbtマルチプロジェクトビルドの使いどころKazuhiro Hara
 
Git -分散バージョン管理システム-
Git -分散バージョン管理システム-Git -分散バージョン管理システム-
Git -分散バージョン管理システム-Koji Shinba
 
GitLab + Dokku で作る CI/CD 環境
GitLab + Dokku で作る CI/CD 環境GitLab + Dokku で作る CI/CD 環境
GitLab + Dokku で作る CI/CD 環境Kazuhiro Nishiyama
 
Version Control System Tutorial バージョン管理システムチュートリアル
Version Control System Tutorial バージョン管理システムチュートリアルVersion Control System Tutorial バージョン管理システムチュートリアル
Version Control System Tutorial バージョン管理システムチュートリアルComputational Materials Science Initiative
 
猫にはわからないGit講座
猫にはわからないGit講座猫にはわからないGit講座
猫にはわからないGit講座Yusei Yamanaka
 
バージョン管理
バージョン管理バージョン管理
バージョン管理Misa Kondo
 
Git 入門
Git 入門Git 入門
Git 入門y-uti
 
いいこんぶGitマニュアル
いいこんぶGitマニュアルいいこんぶGitマニュアル
いいこんぶGitマニュアルKaito Yuuki
 

Similar to Git (運用編) (20)

Git (実践入門編)
Git (実践入門編)Git (実践入門編)
Git (実践入門編)
 
Gitのよく使うコマンド
Gitのよく使うコマンドGitのよく使うコマンド
Gitのよく使うコマンド
 
Capistrano
CapistranoCapistrano
Capistrano
 
Git-dojo In Sendagaya.rb
Git-dojo In Sendagaya.rbGit-dojo In Sendagaya.rb
Git-dojo In Sendagaya.rb
 
git 初めの一歩
git 初めの一歩git 初めの一歩
git 初めの一歩
 
RedmineとGitとスクラム
RedmineとGitとスクラムRedmineとGitとスクラム
RedmineとGitとスクラム
 
今さら聞けない人のためのGit超入門 GitLab 14対応版
今さら聞けない人のためのGit超入門 GitLab 14対応版今さら聞けない人のためのGit超入門 GitLab 14対応版
今さら聞けない人のためのGit超入門 GitLab 14対応版
 
sbtマルチプロジェクトビルドの使いどころ
sbtマルチプロジェクトビルドの使いどころsbtマルチプロジェクトビルドの使いどころ
sbtマルチプロジェクトビルドの使いどころ
 
Git -分散バージョン管理システム-
Git -分散バージョン管理システム-Git -分散バージョン管理システム-
Git -分散バージョン管理システム-
 
今さら聞けない人のためのGitLabの始め方 Ubuntu編
今さら聞けない人のためのGitLabの始め方 Ubuntu編今さら聞けない人のためのGitLabの始め方 Ubuntu編
今さら聞けない人のためのGitLabの始め方 Ubuntu編
 
GitLab + Dokku で作る CI/CD 環境
GitLab + Dokku で作る CI/CD 環境GitLab + Dokku で作る CI/CD 環境
GitLab + Dokku で作る CI/CD 環境
 
Version Control System Tutorial バージョン管理システムチュートリアル
Version Control System Tutorial バージョン管理システムチュートリアルVersion Control System Tutorial バージョン管理システムチュートリアル
Version Control System Tutorial バージョン管理システムチュートリアル
 
猫にはわからないGit講座
猫にはわからないGit講座猫にはわからないGit講座
猫にはわからないGit講座
 
今さら聞けない人のためのgit超入門
今さら聞けない人のためのgit超入門今さら聞けない人のためのgit超入門
今さら聞けない人のためのgit超入門
 
バージョン管理
バージョン管理バージョン管理
バージョン管理
 
Git 勉強会
Git 勉強会Git 勉強会
Git 勉強会
 
今さら聞けない人のためのGit超入門
今さら聞けない人のためのGit超入門今さら聞けない人のためのGit超入門
今さら聞けない人のためのGit超入門
 
実は怖くないDevOps
実は怖くないDevOps実は怖くないDevOps
実は怖くないDevOps
 
Git 入門
Git 入門Git 入門
Git 入門
 
いいこんぶGitマニュアル
いいこんぶGitマニュアルいいこんぶGitマニュアル
いいこんぶGitマニュアル
 

Recently uploaded

論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 

Recently uploaded (9)

論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 

Git (運用編)

  • 1. Git - 運用編 2012/05/14, DT Corp Naomichi Yamakita
  • 2. 概要 - DTにおけるGitの基本開発サイクル 1. 開発者はoriginからリポジトリのクローンを作成 2. 各自の開発環境で開発を進め、変更内容をテストサーバに反映する 3. テスト環境で動作確認 4. ステージング環境にデプロイ 5. プロダクション環境にデプロイ 6. リリース完了 - 気軽にブランチを切れるため、ルールを決めないと混乱の元となる
  • 3. 運用ポリシー 1/2 - 開発リポジトリでは、仕様書や各種ドキュメント(議事録、見積書、デー タファイル等)を管理しない - Redmine+Google Appsで一元管理 - ファイル名は英語に統一する - 日本語ファイル名は、MacやLinux環境下で動作が不安定なため - デベロッパーポータル: 基本原則: ファイルとディレクトリ http://project.svc-service.net/guideline/ base_guideline.html#file_rule - Gitでは原則的にソースファイル(及び付随するAPI)のみを管理する
  • 4. 運用ポリシー 2/2 - コミットメッセージに変更内容の概要を記す - コミット時に開発関係者へログメールが自動送信される - リポジトリの作成方法(DT社員のみ) $ cd /usr/local/git/repositories/ $ su git $ git init --bare --shared=true {repository_name}.git Initialized empty shared Git repository in /usr/local/git/ repositories/{repository_name}.git/ $ cd ../gitosis-admin/ $ vi gitosis.conf $ git commit -m “add {repository_name” -a $ git push
  • 5. 運用ポリシー 2/2 - コミットメッセージに変更内容の概要を記す - コミット時に開発関係者へログメールが自動送信される - リポジトリの作成方法(DT社員のみ) $ cd /usr/local/git/repositories/ $ su git $ git init --bare --shared=true {repository_name}.git Initialized empty shared Git repository in /usr/local/git/ repositories/{repository_name}.git/ 共有リポジトリの設定 $ cd ../gitosis-admin/ $ vi gitosis.conf $ git commit -m “add {repository_name” -a $ git push
  • 6. 運用ポリシー 2/2 - コミットメッセージに変更内容の概要を記す - コミット時に開発関係者へログメールが自動送信される - リポジトリの作成方法(DT社員のみ) $ cd /usr/local/git/repositories/ $ su git $ git init --bare --shared=true {repository_name}.git Initialized empty shared Git repository in /usr/local/git/ repositories/{repository_name}.git/ 共有リポジトリの設定 $ cd ../gitosis-admin/ $ vi gitosis.conf $ git commit -m “add {repository_name” -a $ git push リポジトリのパーミッションを設定
  • 7. DTが採用するGitの開発モデル - A successful Git branching model - 原文 - http://nvie.com/posts/a-successful-git-branching-model/ - 日本語訳 - http://keijinsonyaban.blogspot.jp/2010/10/successful-git- branching-model.html
  • 8. ブランチの種類 - ブランチの種類 - メインブランチ - master - develop - サポートブランチ - feature - release - hotfix
  • 9. メインブランチとは - 中央リポジトリに存在し、削除されることなく永続的に保持される
  • 10. ブランチの説明に入る前に - 資料内でオレンジ色で書かれた内容はDT独自のローカルルールです
  • 11. メインブランチの種類 - master - 常にリリース可能状態 - 開発では使用しない、タグ付け専用のブランチ - develop - 開発用途のブランチ - 開発完了後はmasterブランチへマージ - この際にmasterブランチ上でタグ付けを行う
  • 12. featureブランチとは - developとは別に並行開発をサポートするブランチを指す - ここでの「並行開発」は、将来的に実装予定の機能やホットフィックス を含む - メインブランチと異なり、目的を達した後はブランチ自体破棄される - (原則的には)originサーバに存在しない
  • 13. featureブランチの種類 1/3 - fuature - 実験段階の機能を開発する際に使用する - ブランチ特性 - 分岐元: develop - マージ先: develop - 場合によってはマージされず破棄されることもありうる - ブランチ名の規則: fuature/{ticket_id} - {ticket_id}: 対応するRedmineのチケットID
  • 14. featureブランチの種類 2/3 - release - 新しい機能をリリースする直前に使用する - マイナーバグフィックスや最終調整はreleaseブランチで行う - ブランチ特性 - 分岐元: develop - マージ先: developとmaster - masterにマージする際はタグを付ける - ブランチ名の規則: release/{yyyymmdd}
  • 15. featureブランチの種類 3/3 - hotfix - リリース済みの製品におけるクリティカルなバグを修正する - developブランチは他の機能を開発中で不安定な可能性がある - ブランチ特性 - 分岐元: master - マージ先: developとmaster - masterにマージする際はタグを付ける - releaseが存在する場合はdevelopの代わりにreleaseにマージ - ブランチ名の規則: hotfix/{yyyymmdd}_{ticket_id}
  • 16. git-flow - A successful Git branching model のモデルを運用しやすくするプラグ イン - https://github.com/nvie/gitflow - git-flowのセットアップ(Windows/Linux/Mac) - http://www.oreilly.co.jp/community/blog/2011/11/branch-model- with-git-flow.html
  • 17. git-flowの実行 - リポジトリとブランチを作成する $ git flow init Initialized empty Git repository in /Users/naomichi/Desktop/ testrep/.git/ No branches exist yet. Base branches must be created now. Branch name for production releases: [master] 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 branch -a * develop master
  • 18. git-flowの実行 - リポジトリとブランチを作成する $ git flow init Initialized empty Git repository in /Users/naomichi/Desktop/ testrep/.git/ No branches exist yet. Base branches must be created now. Branch name for production releases: [master] Branch name for "next release" development: [develop] masterブランチ、featureブランチを命名 How to name your supporting branch prefixes? Feature branches? [feature/] Release branches? [release/] Hotfix branches? [hotfix/] Support branches? [support/] Version tag prefix? [] $ git branch -a * develop master
  • 19. git-flowの実行 - リポジトリとブランチを作成する $ git flow init Initialized empty Git repository in /Users/naomichi/Desktop/ testrep/.git/ No branches exist yet. Base branches must be created now. Branch name for production releases: [master] Branch name for "next release" development: [develop] masterブランチ、featureブランチを命名 How to name your supporting branch prefixes? Feature branches? [feature/] Release branches? [release/] Hotfix branches? [hotfix/] Support branches? [support/] Version tag prefix? [] $ git branch -a * develop master featureブランチは表示されない(後述)
  • 20. featureブランチの作成 1/2 - 新機能の開発を開始する $ echo 'hello' > greeting $ git add . $ git commit -m "first commit" $ git flow feature start 100 Switched to a new branch 'feature/100' Summary of actions: - A new branch 'feature/100' was created, based on 'develop' - You are now on branch 'feature/100' Now, start committing on your feature. When done, use: git flow feature finish 100 $ git branch develop * feature/100 master
  • 21. featureブランチの作成 1/2 - 新機能の開発を開始する $ echo 'hello' > greeting Redmine#100の開発を開始 $ git add . $ git commit -m "first commit" $ git flow feature start 100 Switched to a new branch 'feature/100' Summary of actions: - A new branch 'feature/100' was created, based on 'develop' - You are now on branch 'feature/100' Now, start committing on your feature. When done, use: git flow feature finish 100 $ git branch develop * feature/100 master
  • 22. featureブランチの作成 1/2 - 新機能の開発を開始する $ echo 'hello' > greeting Redmine#100の開発を開始 $ git add . $ git commit -m "first commit" $ git flow feature start 100 Switched to a new branch 'feature/100' Summary of actions: - A new branch 'feature/100' was created, based on 'develop' - You are now on branch 'feature/100' Now, start committing on your feature. When done, use: developブランチを元にfeatureブランチが作成された git flow feature finish 100 $ git branch develop * feature/100 master
  • 23. featureブランチの作成 1/2 - 新機能の開発を開始する $ echo 'hello' > greeting Redmine#100の開発を開始 $ git add . $ git commit -m "first commit" $ git flow feature start 100 Switched to a new branch 'feature/100' Summary of actions: - A new branch 'feature/100' was created, based on 'develop' - You are now on branch 'feature/100' Now, start committing on your feature. When done, use: developブランチを元にfeatureブランチが作成された git flow feature finish 100 $ git branch develop * feature/100 master ブランチが追加される
  • 24. featureブランチの作成 2/2 - featureの開発を終わらせてdevelopに戻る(マージする) $ echo 'good night' > greeting $ git commit -m "second commit" -a $ git flow feature finish 100 Switched to branch 'develop' Updating 01f0874..58f1c0d Fast-forward greeting | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Deleted branch feature/100 (was 58f1c0d). Summary of actions: - The feature branch 'feature/100' was merged into 'develop' - Feature branch 'feature/100' has been removed - You are now on branch 'develop' $ cat greeting good night $ git branch * develop master
  • 25. featureブランチの作成 2/2 - featureの開発を終わらせてdevelopに戻る(マージする) featureブランチの終わりを宣言 $ echo 'good night' > greeting $ git commit -m "second commit" -a $ git flow feature finish 100 Switched to branch 'develop' Updating 01f0874..58f1c0d Fast-forward greeting | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Deleted branch feature/100 (was 58f1c0d). Summary of actions: - The feature branch 'feature/100' was merged into 'develop' - Feature branch 'feature/100' has been removed - You are now on branch 'develop' $ cat greeting good night $ git branch * develop master
  • 26. featureブランチの作成 2/2 - featureの開発を終わらせてdevelopに戻る(マージする) featureブランチの終わりを宣言 $ echo 'good night' > greeting $ git commit -m "second commit" -a $ git flow feature finish 100 Switched to branch 'develop' Updating 01f0874..58f1c0d Fast-forward greeting | 2 +- developブランチにマージされ、featureブランチが削除される 1 files changed, 1 insertions(+), 1 deletions(-) Deleted branch feature/100 (was 58f1c0d). Summary of actions: - The feature branch 'feature/100' was merged into 'develop' - Feature branch 'feature/100' has been removed - You are now on branch 'develop' $ cat greeting good night $ git branch * develop master
  • 27. featureブランチの作成 2/2 - featureの開発を終わらせてdevelopに戻る(マージする) featureブランチの終わりを宣言 $ echo 'good night' > greeting $ git commit -m "second commit" -a $ git flow feature finish 100 Switched to branch 'develop' Updating 01f0874..58f1c0d Fast-forward greeting | 2 +- developブランチにマージされ、featureブランチが削除される 1 files changed, 1 insertions(+), 1 deletions(-) Deleted branch feature/100 (was 58f1c0d). Summary of actions: - The feature branch 'feature/100' was merged into 'develop' - Feature branch 'feature/100' has been removed - You are now on branch 'develop' $ cat greeting good night developブランチにマージされたことが確認できる $ git branch * develop master
  • 28. featureブランチの作成 2/2 - featureの開発を終わらせてdevelopに戻る(マージする) featureブランチの終わりを宣言 $ echo 'good night' > greeting $ git commit -m "second commit" -a $ git flow feature finish 100 Switched to branch 'develop' Updating 01f0874..58f1c0d Fast-forward greeting | 2 +- developブランチにマージされ、featureブランチが削除される 1 files changed, 1 insertions(+), 1 deletions(-) Deleted branch feature/100 (was 58f1c0d). Summary of actions: - The feature branch 'feature/100' was merged into 'develop' - Feature branch 'feature/100' has been removed - You are now on branch 'develop' $ cat greeting good night developブランチにマージされたことが確認できる $ git branch * develop featureブランチは削除済み master
  • 29. releaseブランチの作成 1/2 - リリースバージョンを作成 $ git flow release start 20120401 Switched to a new branch 'release/20120401' Summary of actions: - A new branch 'release/20120401' was created, based on 'develop' - You are now on branch 'release/20120401' Follow-up actions: - Bump the version number now! - Start committing last-minute fixes in preparing your release - When done, run: git flow release finish '20120401' $ git branch develop master * release/20120401
  • 30. releaseブランチの作成 1/2 - リリースバージョンを作成 $ git flow release start 20120401 releaseブランチを開始 Switched to a new branch 'release/20120401' Summary of actions: - A new branch 'release/20120401' was created, based on 'develop' - You are now on branch 'release/20120401' Follow-up actions: - Bump the version number now! - Start committing last-minute fixes in preparing your release - When done, run: git flow release finish '20120401' $ git branch develop master * release/20120401
  • 31. releaseブランチの作成 1/2 - リリースバージョンを作成 $ git flow release start 20120401 releaseブランチを開始 Switched to a new branch 'release/20120401' Summary of actions: - A new branch 'release/20120401' was created, based on 'develop' - You are now on branch 'release/20120401' Follow-up actions: - Bump the version number now! developブランチを元にreleaseブランチが作成された - Start committing last-minute fixes in preparing your release - When done, run: git flow release finish '20120401' $ git branch develop master * release/20120401
  • 32. releaseブランチの作成 1/2 - リリースバージョンを作成 $ git flow release start 20120401 releaseブランチを開始 Switched to a new branch 'release/20120401' Summary of actions: - A new branch 'release/20120401' was created, based on 'develop' - You are now on branch 'release/20120401' Follow-up actions: - Bump the version number now! developブランチを元にreleaseブランチが作成された - Start committing last-minute fixes in preparing your release - When done, run: git flow release finish '20120401' $ git branch develop releaseブランチがアクティブになる master * release/20120401
  • 33. releaseブランチの作成 2/2 - プログラムの微調整を加えた後にリリースを行う $ echo 'good mornink' good mornink $ git commit -m "first commit" $ git flow release finish 1.0 Switched to branch 'master' Merge made by recursive. greeting | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 greeting create mode 100644 hello Deleted branch release/1.0 (was 58f1c0d). Summary of actions: - Latest objects have been fetched from 'origin' - Release branch has been merged into 'master' - The release was tagged '1.0' - Release branch has been back-merged into 'develop' - Release branch 'release/1.0' has been deleted [naomichi: test]$ git tag 20120401
  • 34. releaseブランチの作成 2/2 - プログラムの微調整を加えた後にリリースを行う $ echo 'good mornink' good mornink $ git commit -m "first commit" $ git flow release finish 1.0 Switched to branch 'master' Merge made by recursive. greeting | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 greeting releaseブランチを終了し、master/developブランチにマージする create mode 100644 hello Deleted branch release/1.0 (was 58f1c0d). Summary of actions: - Latest objects have been fetched from 'origin' - Release branch has been merged into 'master' - The release was tagged '1.0' - Release branch has been back-merged into 'develop' - Release branch 'release/1.0' has been deleted [naomichi: test]$ git tag 20120401
  • 35. releaseブランチの作成 2/2 - プログラムの微調整を加えた後にリリースを行う $ echo 'good mornink' good mornink $ git commit -m "first commit" $ git flow release finish 1.0 Switched to branch 'master' Merge made by recursive. greeting | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 greeting releaseブランチを終了し、master/developブランチにマージする create mode 100644 hello Deleted branch release/1.0 (was 58f1c0d). Summary of actions: - Latest objects have been fetched from 'origin' - Release branch has been merged into 'master' - The release was tagged '1.0' - Release branch has been back-merged into 'develop' - Release branch 'release/1.0' has been deleted [naomichi: test]$ git tag 20120401 マージとmasterブランチへのタグ付けが行われた
  • 36. hotfixブランチの作成 1/2 - リリース済みのプログラムに対し修正を加える $ git flow hotfix start 20120401_200 Switched to a new branch 'hotfix/20120401_200' Summary of actions: - A new branch 'hotfix/20120401_200' was created, based on 'master' - You are now on branch 'hotfix/20120401_200' Follow-up actions: - Bump the version number now! - Start committing your hot fixes - When done, run: git flow hotfix finish '20120401_200' $ git branch develop * hotfix/20120401_200 master
  • 37. hotfixブランチの作成 1/2 - リリース済みのプログラムに対し修正を加える Redmine#200のホットフィックスを開始 $ git flow hotfix start 20120401_200 Switched to a new branch 'hotfix/20120401_200' Summary of actions: - A new branch 'hotfix/20120401_200' was created, based on 'master' - You are now on branch 'hotfix/20120401_200' Follow-up actions: - Bump the version number now! - Start committing your hot fixes - When done, run: git flow hotfix finish '20120401_200' $ git branch develop * hotfix/20120401_200 master
  • 38. hotfixブランチの作成 1/2 - リリース済みのプログラムに対し修正を加える Redmine#200のホットフィックスを開始 $ git flow hotfix start 20120401_200 Switched to a new branch 'hotfix/20120401_200' Summary of actions: - A new branch 'hotfix/20120401_200' was created, based on 'master' - You are now on branch 'hotfix/20120401_200' Follow-up actions: - Bump the version number now! masterブランチを元にhotfixブランチを作成 - Start committing your hot fixes - When done, run: git flow hotfix finish '20120401_200' $ git branch develop * hotfix/20120401_200 master
  • 39. hotfixブランチの作成 1/2 - リリース済みのプログラムに対し修正を加える Redmine#200のホットフィックスを開始 $ git flow hotfix start 20120401_200 Switched to a new branch 'hotfix/20120401_200' Summary of actions: - A new branch 'hotfix/20120401_200' was created, based on 'master' - You are now on branch 'hotfix/20120401_200' Follow-up actions: - Bump the version number now! masterブランチを元にhotfixブランチを作成 - Start committing your hot fixes - When done, run: git flow hotfix finish '20120401_200' $ git branch develop hotfixブランチが追加される * hotfix/20120401_200 master
  • 40. hotfixブランチの作成 2/2 - ホットフィックスの適用 $ echo 'good night' > greeting $ git commit -m "fixed spell" -a # On branch hotfix/20120401_200 nothing to commit (working directory clean) $ git flow hotfix finish 20120401_200 Switched to branch 'develop' Already up-to-date! Merge made by recursive. Deleted branch hotfix/20120401_200 (was 8aeddfd). Summary of actions: - Latest objects have been fetched from 'origin' - Hotfix branch has been merged into 'master' - The hotfix was tagged '20120401_200' - Hotfix branch has been back-merged into 'develop' - Hotfix branch 'hotfix/20120401_200' has been deleted
  • 41. hotfixブランチの作成 2/2 - ホットフィックスの適用 $ echo 'good night' > greeting $ git commit -m "fixed spell" -a # On branch hotfix/20120401_200 スペルミスを修正してコミット nothing to commit (working directory clean) $ git flow hotfix finish 20120401_200 Switched to branch 'develop' Already up-to-date! Merge made by recursive. Deleted branch hotfix/20120401_200 (was 8aeddfd). Summary of actions: - Latest objects have been fetched from 'origin' - Hotfix branch has been merged into 'master' - The hotfix was tagged '20120401_200' - Hotfix branch has been back-merged into 'develop' - Hotfix branch 'hotfix/20120401_200' has been deleted
  • 42. hotfixブランチの作成 2/2 - ホットフィックスの適用 $ echo 'good night' > greeting $ git commit -m "fixed spell" -a # On branch hotfix/20120401_200 スペルミスを修正してコミット nothing to commit (working directory clean) $ git flow hotfix finish 20120401_200 Switched to branch 'develop' Already up-to-date! Merge made by recursive. ホットフィックスを終わらせる Deleted branch hotfix/20120401_200 (was 8aeddfd). Summary of actions: - Latest objects have been fetched from 'origin' - Hotfix branch has been merged into 'master' - The hotfix was tagged '20120401_200' - Hotfix branch has been back-merged into 'develop' - Hotfix branch 'hotfix/20120401_200' has been deleted
  • 43. hotfixブランチの作成 2/2 - ホットフィックスの適用 $ echo 'good night' > greeting $ git commit -m "fixed spell" -a # On branch hotfix/20120401_200 スペルミスを修正してコミット nothing to commit (working directory clean) $ git flow hotfix finish 20120401_200 Switched to branch 'develop' Already up-to-date! Merge made by recursive. ホットフィックスを終わらせる Deleted branch hotfix/20120401_200 (was 8aeddfd). Summary of actions: - Latest objects have been fetched from 'origin' - Hotfix branch has been merged into 'master' - The hotfix was tagged '20120401_200' - Hotfix branch has been back-merged into 'develop' - Hotfix branch 'hotfix/20120401_200' has been deleted ホットフィックスをmaster/developブランチに反映
  • 44. 今後の運用方針案 - コミット時にRedmineのチケットIDを必須とする - 変更内容とチケットを紐付けることで、変更の流れが掴みやすくなる - コミットフックでPHPのシンタックスチェック

Editor's Notes

  1. \n
  2. \n
  3. \n
  4. \n
  5. \n
  6. \n
  7. \n
  8. \n
  9. \n
  10. \n
  11. \n
  12. \n
  13. ・releaseブランチで大きな変更を加えてはならない\n
  14. \n
  15. \n
  16. \n
  17. \n
  18. ・featureブランチは並行で複数作成される可能性もある\n
  19. ・featureブランチは並行で複数作成される可能性もある\n
  20. ・featureブランチは並行で複数作成される可能性もある\n
  21. \n
  22. \n
  23. \n
  24. \n
  25. \n
  26. \n
  27. \n
  28. \n
  29. \n
  30. \n
  31. \n
  32. \n
  33. \n
  34. \n
  35. \n
  36. \n