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
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
170
Jakarta EE meets AI
ivargrimstad
0
210
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
930
TypeScriptでライブラリとの依存を限定的にする方法
tutinoko
3
690
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
300
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
初めてDefinitelyTypedにPRを出した話
syumai
0
420
Jakarta EE meets AI
ivargrimstad
0
590
Jakarta EE meets AI
ivargrimstad
0
660
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Done Done
chrislema
181
16k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
It's Worth the Effort
3n
183
27k
Producing Creativity
orderedlist
PRO
341
39k
Scaling GitHub
holman
458
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
506
140k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
900
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 ʢ←ʂ