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
P2B Haus法人サポータープランのご提案
sotarok
1
25
ソフトウェア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
21
10k
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.5k
Wiki についての今昔物語 / Crowi
sotarok
5
14k
Other Decks in Programming
See All in Programming
PSR-15 はあなたのための ものではない? - phpcon2024
myamagishi
0
120
103 Early Hints
sugi_0000
1
230
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
4
490
Go の GC の不得意な部分を克服したい
taiyow
3
790
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
Refactor your code - refactor yourself
xosofox
1
260
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
390
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
760
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
95
5.2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
The Cost Of JavaScript in 2023
addyosmani
45
7k
Done Done
chrislema
181
16k
Building Your Own Lightsaber
phodgson
103
6.1k
GitHub's CSS Performance
jonrohan
1030
460k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Site-Speed That Sticks
csswizardry
2
190
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.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 ʢ←ʂ