Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
gitのブランチ戦略
Search
takashabe
February 26, 2015
Programming
8
5.7k
gitのブランチ戦略
社内LT大会で話した資料です。
takashabe
February 26, 2015
Tweet
Share
More Decks by takashabe
See All by takashabe
より良いターミナルでの生活を求めて
takashabe
0
13
OpenCensusでcustom context propagationとexporterを書いた話 / OpenCensus with custom context propagation and exporter
takashabe
0
1.5k
pubsub with concurrent
takashabe
1
820
社内ISUCONを開催した話
takashabe
0
1.5k
ISUCON大反省会
takashabe
0
1.8k
サルでもわかるgit
takashabe
0
1.3k
playで複数DBする
takashabe
0
1.6k
MySQLで高トラフィックに立ち向かう
takashabe
0
1.7k
GitHubの良さ
takashabe
2
2.2k
Other Decks in Programming
See All in Programming
Swiftコードバトル必勝法
toshi0383
0
150
Our Websites Need a Lifestyle Change, Not a Diet
ryantownsend
0
140
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
130
Scala におけるコンパイラエラーとの付き合い方
chencmd
2
420
The Shape of a Service Object
inem
0
520
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
210
全部見せます! クラシルリワードのSwiftTesting移行プロジェクト
uetyo
0
210
メモリ最適化を究める!iOSアプリ開発における5つの重要なポイント
yhirakawa333
0
410
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
640
watsonx.ai Dojo #2 生成AIを使ったアプリ開発入門編
oniak3ibm
PRO
0
110
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
220
実践!難読化ガイド
mitchan
0
160
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
21
3k
Testing 201, or: Great Expectations
jmmastey
36
7k
Why Our Code Smells
bkeepers
PRO
334
56k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
8.9k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Adopting Sorbet at Scale
ufuk
73
8.9k
Producing Creativity
orderedlist
PRO
340
39k
Code Reviewing Like a Champion
maltzj
517
39k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.4k
From Idea to $5000 a Month in 5 Months
shpigford
379
46k
A Philosophy of Restraint
colly
202
16k
Transcript
gitのブランチ戦略 Takashi Abe Mynet Inc. 24/02 2015
git初心者あるある
ブランチの子供が出来過ぎ てマージ困難
いつの間にかmasterに取り 込まれるコミット
None
ブランチ戦略決めましょう
ブランチ戦略とは 新機能開発やリリースなど、各用途専用のブランチを用 意する 各ブランチに明確な意図を持たせて混ざらないように することで複数人での開発をやりやすくする
メジャーなブランチ戦略 git-flow 5種類のブランチを使って機能開発、リリース、hotfix などの役割を明確に分けている 堅牢なモデルだが慣れないうちは煩雑 github flow masterと機能開発ブランチのみを持つ masterはすぐデプロイするワイルドなモデル
git-flow
使用するブランチ develop 開発安定版ブランチ。featureブランチなどはここにマージされる feature 機能開発用ブランチ。機能開発やバグフィックスなどの開発を機能ごとに開発する ためのブランチ。最終的にdevelopにマージされる release リリース用ブランチ。リリース時にdevelopから作成される。リリース作業中でも developに対する変更を行えるようになる。 master
安定版ブランチ。リリースを終えたreleaseブランチからmasterにマージされる。 hotfix 緊急のバグ修正ブランチ。masterから作成され、releaseブランチを介さずにそのま まmasterにマージされる。
None
feature
release
hotfix
git-flowの特徴 releaseやhotfixのための手順が明確に定められていて プロダクションに上げるコードを堅牢に保つことが出来 る 使用するブランチが多いため手順が煩雑
github flow
使用するブランチ master 安定版、リリース用ブランチ。featureブランチは全て masterにマージされ、即座にデプロイ対象になる。 feature 機能開発用ブランチ。masterから作成され、そのまま masterにマージされる。
None
github flowの特徴 使用するブランチが最小限で理解しやすい masterを常にデプロイ可能な状態にしないといけない コードレビュー CI
弊チームのブランチ戦略
やりたいこと
やりたいこと 規模の大きい新機能など、複数人で1つの機能を作りた い リリースする機能は絞る場合がある リリース前にQA環境でQAしたい
git-flowのアレンジ
featureブランチの亜種を2 つ追加した
追加したfeatureブランチ feature-develop 1つの大きな機能における開発安定版。developから 作成され、feature-developから更にfeatureブランチ を作成する。featureブランチはfeature-developブラ ンチにマージされる。 QA QA用ブランチ。developから作成され、次回リリースに 盛り込むブランチを全てマージする。ここにはfeature- developブランチが含まれる。
機能開発フロー developブランチからfeature-developブランチを作成 feature-developブランチからfeatureブランチを作成 featureブランチをfeature-developブランチにマージ
リリースフロー feature-developブランチをQAブランチにマージ QA中の修正は全てQAブランチにマージ QAが完了したらreleaseブランチにマージ
None
tips
ブランチを作るとき ブランチ作成時は常にリモートブランチから作成するこ とを意識する git checkout -b feature/a origin/develop GitHubなどのGUIフロントエンドが使えればそれでも 古いローカルブランチから作成することによってリモート
の最新コミットが取り込まれない コンフリクトの原因になる
CUIでやる SourceTreeなど優秀なGUIツールを使うのもいいが、git の構造を知るにはCUIでやると捗る ローカル/リモートリポジトリの違い working copy,index,ローカルリポジトリの違い 慣れるとGUIでやるよりも捗る(と思う)