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
Developing with Git and Pull Request / Git x Pu...
Search
Sotaro Karasawa
September 15, 2012
Programming
21
14k
Developing with Git and Pull Request / Git x Pull Request でチーム開発
PHPカンファレンス2012 発表資料 / PHP Conference Tokyo 2012
Sotaro Karasawa
September 15, 2012
Tweet
Share
More Decks by Sotaro Karasawa
See All by Sotaro Karasawa
ソフトウェアxスタートアップから見た飲食と配送の世界 / The World of Food Deliverlies and Restaurant Businesses from a Software and Startup Perspective
sotarok
2
1.2k
CTO 3度目の正直 / My 3rd CTO Career
sotarok
20
9.7k
Introduction to the Corporate Solutions Engineering at MTC2018
sotarok
1
36k
Mercari meetup for Corporate Engineering #1 / What is "Corporate Engineering"?
sotarok
2
2.3k
Markdown and WYSIWYG
sotarok
1
5.9k
20 Jan 2017 / Moving Beyond Borders - Mercari DAY
sotarok
8
15k
PHPBLT の心得 / PHPBLT #5 @ペパボ
sotarok
5
3.4k
Wiki についての今昔物語 / Crowi
sotarok
5
14k
PHPでダイエット / Dietcube #phpblt
sotarok
2
4.3k
Other Decks in Programming
See All in Programming
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.2k
カラム追加で増えるActiveRecordのメモリサイズ イメージできますか?
asayamakk
4
1.9k
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
280
CSC509 Lecture 09
javiergs
PRO
0
140
Tuning GraphQL on Rails
pyama86
2
1.2k
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
160
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
540
受け取る人から提供する人になるということ
little_rubyist
0
180
PLoP 2024: The evolution of the microservice architecture pattern language
cer
PRO
0
2.4k
JavaでLチカしたい! / JJUG CCC 2024 Fall LT
nhayato
0
110
C++でシェーダを書く
fadis
6
3.9k
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
170
Featured
See All Featured
KATA
mclloyd
29
14k
Fashionably flexible responsive web design (full day workshop)
malarkey
404
65k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Code Reviewing Like a Champion
maltzj
520
39k
Measuring & Analyzing Core Web Vitals
bluesmoon
3
76
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Thoughts on Productivity
jonyablonski
67
4.3k
Six Lessons from altMBA
skipperchong
27
3.5k
Teambox: Starting and Learning
jrom
133
8.8k
GraphQLとの向き合い方2022年版
quramy
43
13k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
Transcript
Crocos, Inc. Sotaro Karasawa @sotarok http://facebook.com/sotarok PHP Conference Tokyo 2012
/ Sep 15, 2012 Git x Pull Request νʔϜ։ൃ࠷ऴԞٛ
Git
CTO @ Crocos, Inc. Ethna git-daily ύʔϑΣΫτPHP ࣗݾհ Sotaro Karasawa
/ @sotarok ฑ૱ଠ 1985/09/15 ੜ·Ε
None
Crocos, Inc (Ϋϩίε) FacebookΛத৺ʹιʔγϟϧάϥϑΛར༻͠ ͨΞϓϦέʔγϣϯ։ൃ ઃཱ 2011/2 2012/8 ~ Yahoo!
JAPAN http://crocos.co.jp/ http://www.facebook.com/Crocos.Inc
Git Λͬͨ։ൃ
Git Ҡߦ ʹ͍ͭͯߟ͑Δ
svn up git pull
svn ci git push
Ͱͳ͍ʂ
Gitʹ Ҡߦ͢Δ ͱ
Git ʹҠߦ͢Δͱɺ ͋Δ͍ Git Λͬͯ։ൃΛ͢Δ͜ͱ svn ʹରԠ͢ΔίϚϯυΛ֮͑Δ͜ͱͰ ͳ͘ɺ Git Λ࠷େݶ׆༻Ͱ͖Δ։ൃϑϩʔΛߟ
͑ɺνʔϜ։ൃʹద༻͢Δ͜ͱͰ͋Δ
Git Λ࠷େݶ׆༻Ͱ͖Δ։ൃϑϩʔͱʁ
ɾϩʔΧϧͰؾܰʹίϛοτ ɾϩʔΧϧͰؾܰʹϒϥϯνΛΔ ɾݡ͘ɺߴͳϚʔδ Git Λ࠷େݶ׆༻Ͱ͖Δ։ൃϑϩʔͱʁ
ɾϩʔΧϧͰؾܰʹίϛοτ ɾϩʔΧϧͰؾܰʹϒϥϯνΛΔ ɾݡ͘ɺߴͳϚʔδ Git Λ࠷େݶ׆༻Ͱ͖Δ։ൃϑϩʔͱʁ ͜ΕΛੜ͔ͨ͠ϒϥϯνઓུ
Git ͷϒϥϯνઓུ
ͲͷΑ͏ʹϒϥϯνΛΓɺ ɾʑͷ։ൃ ɾϦϦʔε ɾۓٸରԠ ͳͲΛ͜ͳ͔͢ ϒϥϯνઓུͬͯʁ
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
None
master develop release feature hotfix
master ৗʹɺ࠷৽ͷ҆ఆͨ͠ ιʔείʔυ͕खʹೖΔ (ϦϦʔε͞Εͨίʔυ)
develop ʑͷ։ൃΛߦ͏ merge
release ϦϦʔεલͷ ֬ೝΛߦ͏ ඞཁ͕͋Ε मਖ਼͢Δ release/1.0.2 ྫ:
release ϦϦʔεલ࠷ऴ֬ೝ
release ෆ۩߹ൃݟ मਖ਼ίϛοτ
release ϦϦʔεϓϩηεʹೖͬ ͯɺ։ൃΛܧଓͰ͖Δ
release मਖ਼ྃɺ͠ ͨιʔεΛ masterʹmerge
release मਖ਼ͨ݁͠ՌΛ developʹө
feature ෳͷҟͳΔ ػೳΛฏߦͯ͠ ։ൃΛਐΊΔ
feature ͨ͠Β developʹmerge feature/hoge
feature ಉ࣌ʹ͍ͭ͘Ͱฏ ߦͯ͠࡞ۀͰ͖Δ feature/hoge feature/fuga
hotfix develop ͷ Λͨͣʹ master ͷ मਖ਼͕͍ͨ͠ʂ
hotfix
hotfix master͔Β ϒϥϯνΛͬ ͯमਖ਼
hotfix मਖ਼͕ऴΘͬͨΒ masterʹϚʔδ͠ ͯϦϦʔε
hotfix વมߋ༰ developʹө
None
Git ͷͨΊʹɺΑ͘ߟ͑ΒΕͨ ϒϥϯνӡ༻Ϟσϧ ༷ʑͳӡ༻ํ๏ʹɺॊೈʹରԠՄೳ A Successful Git Branching Model
gitflow nvieࢯۘɻ git-daily ࡞ɻ WebαʔϏε։ൃ͚ʹΞϨϯδ A Successful Git Branching Model
Λ࣮ݱ͢Δπʔϧ
͚ͩͲ... ඞͣ͜ͷ௨ΓΒͳ͚Ε͍͚ͳ͍͜ͱ ͳ͍ ͜ΕΛࢀߟʹɺࣗͷνʔϜͰͷӡ༻ϑ ϩʔʹ߹͏Α͏ʹΞϨϯδ A Successful Git Branching Model
ϒϥϯνӡ༻ϞσϧͷϕετϓϥΫςΟε
ɾසൟʹϦϦʔε͞ΕΔWebαʔϏε ɾ͍͍ͪͪόʔδϣϯ൪߸͚ͭͳ͍ ɾ͍͍ͪͪλάΛ͚ͭͳ͍ ɾͰϦϦʔεϒϥϯν ɾϦϞʔτ࿈ܞ(νʔϜӡ༻)Λߟྀ ɾPHP $ pear install openpear/git_daily
git-daily ΞϨϯδ ... ͨͱ͑
Pull Request Λͬͨ։ൃϑϩʔ
Pull Request ͱ ɾGitHub ͱ͔ʹ͋Δͭ A ͕ॻ͍ͨίʔυʹରͯ͠ ... Bʮ͜Μͳػೳ͕ཉ͍͔͠Β͜ΜͳมߋΛ ॻ͍ͯΈͨΑɻͱΓ͜ΜͰʂʯ
AʮOKɺpull ͠·͢ʯ Έ͍ͨͳͭ
Pull Request ͷԿ͕ྑ͍͔ ʮPull Requestʯ Φʔϓϯιʔεʹݶ Βͣ͑Δ༏Εͨ։ൃϑϩʔͩ http://d.hatena.ne.jp/sotarok/20120219/1329581585 खલຯḩͰ͕͢ɺ ੋඇಡΜͰ͍ͩ͘͞ʂ
ίʔυͷมߋ ෳਓͰ։ൃ͢ΔͷͰ͋Εɺ ʮଞਓ͕ॻ͍ͨίʔυʯ Λมߋ͠ͳ͚Ε͍͚ͳ͍λΠϛϯά͕ ඞͣ͋Δ
(1) ґཔλΠϓ
(2) શ૿৩λΠϓ
(3) উखʹมߋλΠϓ
(4) Pull Request λΠϓ
ϒϥϯνઓུʹ Pull Request Λ ΈࠐΉ
feature/hoge feature/fuga
feature/hoge feature/fuga mergeલʹ pull request ϨϏϡʔ mergeલʹ pullrequest ͰϨϏϡʔ
ࡉԽ͞Εͨ ɹɹίʔυϨϏϡʔ
ޮՌత
Pull Request Ϛʔδ࣌ͷ ϨϏϡʔͳͥޮՌత͔ ɾมߋͷίϯςΩετ͕໌֬ વɺਖ਼͘͠ feature ϒϥϯν͕ӡ༻͞Ε͍ͯΔ͜ ͱલఏͱͳΔɻܒ׆ಈඞཁɻ ɾখ͞ͳpatch
ϨϏϡʔ͢Δରͷίʔυখ͚͞Εখ͍͞΄ ͲɺϨϏϡʔίετԼ͕Δ
Pull Request ͷԿ͕ྑ͍͔ (·ͱΊ) ɾύονͷΓͱΓ͕ՄࢹԽ͞ΕɺΦʔ ϓϯͰɺهΔ ɾ ֘ͷίʔυͷΛ࣋ͭਓ͕͍Δ ɾมߋ͞ΕΔίʔυΛݩʹ͕ٞͰ͖Δ ɾখ͞ͳpatchͰ࣭ͷߴ͍ϨϏϡʔ
ɾϦϑΝΫλ
Pull Request Λఏڙ͢ΔγεςϜ ɾGitHub (༗ྉͰprivateϦϙδτϦ) ඇਪɻprivate ϦϙδτϦɺEnterprise ΑΓ͍҆ ͚Ͳ ...
མͪͯΔͱϦϦʔεͰ͖ͳ͍ΑͶ ɾGitHub Enterprise ͓͕ۚ͋ΔͳΒΦεεϝɻ ɾGitLab ແྉɻϝϯςେมɻMerge Requestɻଟগόάͬ ͯෆຬΛݴΘͳ͍ খنͳνʔϜͳΒΦεεϝɻ
Pull Request Λఏڙ͢ΔγεςϜ GHE GitLab Ձ֨ $21/user/݄ ແྉ ϝϯςφϯείετ ͍
(ແ Ͱͳ͍) ߴ͍ Repository Viewer ˕ ˕ Network Chart ˕ ˕ User Namespace / Fork ˕ × Pull Request ˕ ˕ Auto Merge (Web͔Β) ˕ ˕
Pull Request Λఏڙ͢ΔγεςϜ GHE GitLab Ձ֨ $21/user/݄ ແྉ ϝϯςφϯείετ ͍
(ແ Ͱͳ͍) ߴ͍ Repository Viewer ˕ ˕ Network Chart ˕ ˕ User Namespace / Fork ˕ × Pull Request ˕ ˕ Auto Merge (Web͔Β) ˕ ˕ EJGGϏϡʔ มߋϑΝΠϧϦετɾEJGGϏϡʔ ίϝϯτ ߦίϝϯτ 8FCΠϯλʔϑΣΠε͔ΒͷࣗಈϚʔδ ϚʔδޙࣗಈΫϩʔζ
GitLab
ΫϩίεͰͷࣄྫ
GitLab ಋೖ & Pull Request ඞਢʹ ɾجຊతʹ feature ϒϥϯνΛͭ͘Δ ʢ͜ΕͦΕҎલ͔ΒͰ͖͍ͯͨʣ
ɾ2ਓ1 (1ਓͱϦʔμʔͱܾΊΔ) ͰνʔϜΛ࡞Γɺඞ ͣνʔϜϨϏϡʔΛ͢Δ ɾϦʔμʔಉ࢜ޓ͍ʹϨϏϡʔ
ଟஈ feature ϒϥϯν feature/hoge ϨϏϡʔίετͷ૿େ ɾ͓͓͖ͳϒϥϯν ɾͰ͖ΔݶΓɺϒϥϯνେ͖͘͠ͳ͍ ɹʢޙड़ʣ ɾ͚ͩͲɺେ͖͘ͳͬͯ͠·͏߹͕͋ Δ
→ϨϏϡʔίετͷ૿େɾϙΠϯτ͕ζ ϨΔ → Pull Request ҙຯͳ͍
ଟஈ feature ϒϥϯν feature/hoge feature/hoge-admin feature/hoge-batch mergeલʹ pull request ϨϏϡʔ
mergeલʹ pull request ϨϏϡʔ
݁Ռ
ࣗͷ୲Ҏ֎ͷ ෦ͷ࣮ɾ༷ͷ Ѳ͕Ͱ͖ΔΑ͏ʹͳΔ େࣄͳ͜ͱ͔ͩΒ͏
͓ޓ͍ʹɺͩΕ͕ Ͳ͏͍͏ίʔυΛ ॻ͘ͷ͔ΛΘ͔Δ Α͏ʹͳΔ େࣄͳ͜ͱ͔ͩΒ͏
ίϐϖݩ͝ͱ ᓲ໓͢Δػձ͕Ͱ͖ͨ
͏·͍͘͘ίπ
1. Ͱ͖Δ͚ͩࡉ͔͘ϦϦʔε
2. খ͞ΊͷνʔϜʹׂ͢Δ
࠷ޙʹ
GitΛ͔ͭͬͨνʔϜ։ൃ ɾʮSVNΛஔ͖͑ΔʯͰͳ͍ ɾ։ൃϑϩʔ͔Βߏங͢͠ ɾͥͻ Pull Request ϕʔεͷ։ൃΛ ɾେ͖ͳձࣾͰɺখ͞ͳϓϩδΣΫτ͔Β Ҡߦͯ͠ܒ͍ͯ͘͠ͳͲɺਐΊํʹ͕ ඞཁ
ਖ਼ղͳ͍ ɾࣄྫ͋͘·Ͱࣄྫ ɾ৫ʹ͋ͬͨΓ͔ͨΛݟ͚ͭΑ͏ʂ ɾ͖ͬ͞ͷ@halt͞Μͷͱ͔ʂ ɾΠέͯͳ͍ͱ͜ΖͲΜͲΜվળ ɾ։ൃϑϩʔ/ۀϑϩʔৗʹݟ͢ ɾͥͻɺϊϋͷڞ༗͠·͠ΐ͏ʂ
࠷ޙʹ... ΤϯδχΞืू͍ͯ͠·͢ʂʂ ָ͍͠Αʂʂ ࣭͝ʁ strk.jp/w ʢ←ʂ