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.1k
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
ビット演算の話 / Let's play with bit operations
kaityo256
PRO
4
180
NEWTにおけるiOS18対応の進め方
ryu1sazae
0
240
Kotlin Multiplatform at Stable and Beyond (Kotlin Vienna, October 2024)
zsmb
2
370
複数プロダクトの技術改善・クラウド移行に向き合うチームのフレキシブルなペア・モブプログラミングの実践 / Flexible Pair Programming And Mob Programming
honyanya
0
230
Hi, have you met Kotlin Multiplatform? | DevFest Vienna 2024
prof18
0
180
データフレームライブラリ徹底比較
daikikatsuragawa
2
110
クラウドサービスの 利用コストを削減する技術 - 円安の真南風を感じて -
pyama86
3
400
4年間変わらなかった YOUTRUSTのアーキテクチャ
daiki1003
1
640
UnJSで簡単に始めるCLIツール開発 / cli-tool-development-with-unjs
aoseyuu
2
310
Cohesion in Modeling and Design
mploed
3
220
メルカリ ハロ アプリの技術スタック
atsumo
2
830
Cloud Adoption Framework にみる組織とクラウド導入戦略
tomokusaba
2
560
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
Web Components: a chance to create the future
zenorocha
310
42k
The Mythical Team-Month
searls
218
43k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
105
48k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
49k
Agile that works and the tools we love
rasmusluckow
327
21k
What's in a price? How to price your products and services
michaelherold
243
11k
The Cult of Friendly URLs
andyhume
77
6k
The Pragmatic Product Professional
lauravandoore
31
6.2k
Six Lessons from altMBA
skipperchong
26
3.4k
A better future with KSS
kneath
237
17k
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 ʢ←ʂ