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
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.4k
Wiki についての今昔物語 / Crowi
sotarok
5
14k
PHPでダイエット / Dietcube #phpblt
sotarok
2
4.3k
Other Decks in Programming
See All in Programming
Thoughts and experiences on Rust and TypeScript
unvalley
2
220
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.8k
HTTP compression in PHP and Symfony apps
dunglas
2
1.6k
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
890
Missing parts when designing and implementing Android UI
ericksli
0
400
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
140
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
380
Symfony Mapper Component
soyuka
2
660
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
4
810
PaaSとSaaSの境目で信頼性と開発速度を両立する 〜TROCCO®︎のこれまでとこれから〜
gtnao
6
7.5k
Cognitoが大型アップデート!Managed Loginとパスワードレスログインを実際に使ってみた@しむそくRadio Special Day1
tmhirai
3
300
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
3.9k
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
The Language of Interfaces
destraynor
154
24k
Making Projects Easy
brettharned
116
5.9k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Writing Fast Ruby
sferik
627
61k
Code Review Best Practice
trishagee
65
17k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Rails Girls Zürich Keynote
gr2m
94
13k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
1
150
Music & Morning Musume
bryan
46
6.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 ʢ←ʂ