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
「Gitによるバージョン管理」の執筆者によるGit勉強会か講演会 / git bundle
Search
Nobuhiro Iwamatsu
February 29, 2012
Programming
6
5.5k
「Gitによるバージョン管理」の執筆者によるGit勉強会か講演会 / git bundle
「Gitによるバージョン管理」の執筆者によるGit勉強会か講演会 / git bundle についてのスライドです。
Nobuhiro Iwamatsu
February 29, 2012
Tweet
Share
More Decks by Nobuhiro Iwamatsu
See All by Nobuhiro Iwamatsu
「Gitによるバージョン管理」の執筆者によるGit勉強会か講演会
iwamatsu
1
2.7k
Other Decks in Programming
See All in Programming
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
240
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
920
42 best practices for Symfony, a decade later
tucksaun
1
180
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
180
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
370
Haze - Real time background blurring
chrisbanes
1
510
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
Symfony Mapper Component
soyuka
2
730
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
700
선언형 UI에서의 상태관리
l2hyunwoo
0
140
Criando Commits Incríveis no Git
marcelgsantos
2
170
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
210
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Docker and Python
trallard
42
3.1k
The Invisible Side of Design
smashingmag
298
50k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Gamification - CAS2011
davidbonilla
80
5.1k
Thoughts on Productivity
jonyablonski
67
4.4k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
How to Ace a Technical Interview
jacobian
276
23k
Transcript
. . . . . . ʮGitʹΑΔόʔδϣϯཧʯͷ ࣥචऀʹΑΔGitษڧձ͔ߨԋձ git bundle
ʹ͍ͭͯޠͬͯΈΔ ؠদ ৴༸
[email protected]
(@iwamatsu) 2012 2 ݄ 28
. . . . . . ຊ͔Βফ͞ΕͨηΫγϣϯ: git bundle git
bundle.....
. . . . . . ϦϙδτϦͷΞΫηε • Git ࢄϦϙδτϦܕ
. . . . . . ϦϙδτϦͷΞΫηε • Git ࢄϦϙδτϦܕ
• Git ϦϙδτϦͷΞΫηεํ๏͕ଟ༷
. . . . . . ϦϙδτϦͷΞΫηε • Git ࢄϦϙδτϦܕ
• Git ϦϙδτϦͷΞΫηεํ๏͕ଟ༷ • gitɺWebDAVɺfileɺrsyncɺsshɺmailɺetcɻ
. . . . . . GitΛͬͨ։ൃ
. . . . . . GitΛͬͨ։ൃ A:ʮϦϙδτϦͷߋ৽͍ͨ͠ͷͰύονଷɻ ʯ
. . . . . . GitΛͬͨ։ൃ A:ʮϦϙδτϦͷߋ৽͍ͨ͠ͷͰύονଷɻ ʯ B:ʮαʔόʹϦϙδτϦஔ͍ͱ͍͔ͨΒ͔ͦ͜Β
pull Ͱ͖ΔΑɻ ʯ
. . . . . . GitΛͬͨ։ൃ A:ʮϦϙδτϦͷߋ৽͍ͨ͠ͷͰύονଷɻ ʯ B:ʮαʔόʹϦϙδτϦஔ͍ͱ͍͔ͨΒ͔ͦ͜Β
pull Ͱ͖ΔΑɻ ʯ A:ʮ͋ʔɺ͔͜͜Βͦ͜ͷωοτϫʔΫʹܨ͛Β Εͳ͍ΜͩΑͶɻ ʯ
. . . . . . GitΛͬͨ։ൃ A:ʮϦϙδτϦͷߋ৽͍ͨ͠ͷͰύονଷɻ ʯ B:ʮαʔόʹϦϙδτϦஔ͍ͱ͍͔ͨΒ͔ͦ͜Β
pull Ͱ͖ΔΑɻ ʯ A:ʮ͋ʔɺ͔͜͜Βͦ͜ͷωοτϫʔΫʹܨ͛Β Εͳ͍ΜͩΑͶɻ ʯ Bʮ͊ʁ(AA ུʯ
. . . . . . GitΛͬͨ։ൃ Ͳ͜Ͱ LAN ΠϯλʔωοτͰͭͳ͕͍ͬͯ
ΔͱݶΒͳ͍ɻ
. . . . . . LANΠϯλʔωοτܦ༝ͰϦϙδτ ϦΛߋ৽Ͱ͖ͳ͍
. . . . . . LANΠϯλʔωοτܦ༝ͰϦϙδτ ϦΛߋ৽Ͱ͖ͳ͍ • ࣾ/άϧʔϓձࣾͰͷ͕͠ΒΈ
. . . . . . LANΠϯλʔωοτܦ༝ͰϦϙδτ ϦΛߋ৽Ͱ͖ͳ͍ • ࣾ/άϧʔϓձࣾͰͷ͕͠ΒΈ
• ։ൃִ෦
. . . . . . LANΠϯλʔωοτܦ༝ͰϦϙδτ ϦΛߋ৽Ͱ͖ͳ͍ • ࣾ/άϧʔϓձࣾͰͷ͕͠ΒΈ
• ։ൃִ෦ • ϋʔυΣΞͷ੍ݶʢRS232C ͔͠ແ͍ͱ͔ʣ
. . . . . . LANΠϯλʔωοτܦ༝ͰϦϙδτ ϦΛߋ৽Ͱ͖ͳ͍ • ࣾ/άϧʔϓձࣾͰͷ͕͠ΒΈ
• ։ൃִ෦ • ϋʔυΣΞͷ੍ݶʢRS232C ͔͠ແ͍ͱ͔ʣ • ਅ໘ͳɺωοτϫʔΫ͏ΑΓૣ͍߹ɻ
. . . . . . LANΠϯλʔωοτܦ༝ͰϦϙδτ ϦΛߋ৽Ͱ͖ͳ͍ • ࣾ/άϧʔϓձࣾͰͷ͕͠ΒΈ
• ։ൃִ෦ • ϋʔυΣΞͷ੍ݶʢRS232C ͔͠ແ͍ͱ͔ʣ • ਅ໘ͳɺωοτϫʔΫ͏ΑΓૣ͍߹ɻ • ͦ͜ͰεχʔΧʔωοτϫʔΫΛ͏ɻ
. . . . . . εχʔΧʔωοτϫʔΫ ෳͷίϯϐϡʔλ͕͋ͬͯɺ௨৴ωοτ ϫʔΫ͕ಋೖ͞Ε͍ͯͳ͍ঢ়ଶΛεχʔΧʔωο τͱ͍͏ɻ͜ͷݴ༿͋Δίϯϐϡʔλ͔Βผͷ
ίϯϐϡʔλʹσʔλΛૹΔඞཁ͕Ͱ͖ͨͱ͖ʹ ϑϩοϐʔσΟεΫ MO ͳͲΛ࣋ͬͨਓ͕ؒ Γճ͍ͬͯΔঢ়ଶΛൽͬͯʮεχʔΧʔΛཤ͍ ͨਓؒΛഔհʹͨ͠ωοτϫʔΫʯͱ͍͏ҙຯͰ ͚ͭΒΕͨɻ1 1Wikipedia:εχʔΧʔωοτϫʔΫ͔Βൈਮ
. . . . . . ϦϙδτϦͷΞΫηε • Git ࢄϦϙδτϦܕ
. . . . . . ϦϙδτϦͷΞΫηε • Git ࢄϦϙδτϦܕ
• Git ϦϙδτϦͷΞΫηεํ๏͕ଟ༷
. . . . . . ϦϙδτϦͷΞΫηε • Git ࢄϦϙδτϦܕ
• Git ϦϙδτϦͷΞΫηεํ๏͕ଟ༷ • gitɺWebDAVɺfileɺrsyncɺsshɺmailɺetcɻ
. . . . . . ϦϙδτϦͷΞΫηε • Git ࢄϦϙδτϦܕ
• Git ϦϙδτϦͷΞΫηεํ๏͕ଟ༷ • gitɺWebDAVɺfileɺrsyncɺsshɺmailɺetcɻ • ͪΖΜεχʔΧʔωοτϫʔΫͩͬʂ
. . . . . .
. . . . . . εχʔΧʔωοτϫʔΫରԠ • εχʔΧʔωοτϫʔΫΛ͏ʹʁ
. . . . . . εχʔΧʔωοτϫʔΫରԠ • εχʔΧʔωοτϫʔΫΛ͏ʹʁ •
git bundle Λ͏ɻ
. . . . . . git bundle • bundle
: ଋɺଋঢ়ߏ
. . . . . . git bundle • bundle
: ଋɺଋঢ়ߏ • ओͳػೳ: ίϛοτΛଋʹవΊͯɺϑΝΠϧ ʹग़ྗ͢Δ
. . . . . . git bundle
. . . . . . git bundle
. . . . . . bundle Πϝʔδ࡞ git bundle
create $ git bundle create ../update.bundle v1.0..v2.0 Counting objects: 20, done. Delta compression using up to 4 threads. Compressing objects: 100% (13/13), done. Writing objects: 100% (19/19), 1.24 KiB, done. Total 19 (delta 10), reused 0 (delta 0)
. . . . . . git bundle
. . . . . . εχʔΧʔωοτ ࡞͞ΕͨΠϝʔδΛUSBϝϞϦͳͲʹ ೖΕͯɺϦϙδτϦઌʹҠಈ
bundle Πϝʔδద༻ . . . . . .
bundle Πϝʔδద༻ ͦͷલʹ bundle Πϝʔδݕূ . . . . .
.
. . . . . . bundle Πϝʔδݕূ git bundle
verify
. . . . . . bundle Πϝʔδݕূ git bundle
verify
. . . . . . bundle Πϝʔδݕূ git bundle
verify
. . . . . . bundle Πϝʔδݕূ $ git
bundle verify ../update.bundle The bundle contains 1 ref 187a8a3a13118a52d799998219e9c8f25e1bf9a3 refs/tags/v2.0 The bundle requires these 1 ref 13f2c31dddc39cb0ae6814cc83ce91f240914446 Add data1 ../update.bundle is okay
. . . . . . ݕূΤϥʔʹͳΔύλʔϯ
. . . . . . ݕূΤϥʔʹͳΔύλʔϯ
. . . . . . ݕূΤϥʔʹͳΔύλʔϯ
. . . . . . ݕূΤϥʔʹͳΔύλʔϯ ΤϥʔʹͳΔɻ $ git
bundle verify ../update.bundle error: Repository lacks these prerequisite commits: error: 902bbbc4f0bfc2cec2335123cc590fa600a239c3 Add data1
. . . . . . ݕূΤϥʔʹͳΔύλʔϯ
bundle ΠϝʔδͷऔΓࠐΈ . . . . . .
. . . . . . bundle ΠϝʔδͷऔΓࠐΈ • git
pull git pull ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git fetch git fetch ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git remote git remote update ϦϞʔτϦϙδτϦ໊
. . . . . . bundle ΠϝʔδͷऔΓࠐΈ • git
pull git pull ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git fetch git fetch ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git remote git remote update ϦϞʔτϦϙδτϦ໊ • ϦϑΝϨϯεΛࢦఆ͢Δඞཁ͕͋Δ
. . . . . . bundle ΠϝʔδͷऔΓࠐΈ • git
pull git pull ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git fetch git fetch ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git remote git remote update ϦϞʔτϦϙδτϦ໊ • ϦϑΝϨϯεΛࢦఆ͢Δඞཁ͕͋Δ
. . . . . . bundle Πϝʔδʹ͋ΔϦϑΝϨϯε Λग़ྗ git
bundle list-heads
. . . . . . bundle Πϝʔδʹ͋ΔϦϑΝϨϯε Λग़ྗ $
git bundle list-heads ../update.bundle 187a8a3a13118a52d799998219e9c8f25e1bf9a3 refs/tags/v2.0 ../update.bundle ʹϦϑΝϨϯεͱͯ͠ refs/tags/v2.0 ͷΈؚ͕·Ε͍ͯΔ͜ͱ͕Θ ͔Δɻ
. . . . . . bundle ΠϝʔδͷऔΓࠐΈ • git
pull git pull ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git fetch git fetch ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git remote git remote update ϦϞʔτϦϙδτϦ໊ • ϦϑΝϨϯεΛࢦఆ͢Δඞཁ͕͋Δ
. . . . . . bundle ΠϝʔδͷऔΓࠐΈ • git
pull git pull ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git fetch git fetch ϦϞʔτϦϙδτϦ ϦϑΝϨϯε • git remote git remote update ϦϞʔτϦϙδτϦ໊ • ϦϑΝϨϯεΛࢦఆ͢Δඞཁ͕͋Δ • bundle ϑΝΠϧϦϞʔτϦϙδτϦͱͯ͠ ѻ͑Δ
. . . . . . git pull ϦϑΝϨϯεΛࢦఆ͠ͳ͍߹: $
git pull ../update.bundle fatal: Couldn’t find remote ref HEAD HEAD ͕ bunlde ϑΝΠϧʹؚ·Εͯͳ͍ͷͰΤ ϥʔʹͳΔɻ
. . . . . . git pull ϦϑΝϨϯεΛࢦఆͨ͠߹: $
git pull ../update.bundle refs/tags/v2.0 Receiving objects: 100% (19/19), done. Resolving deltas: 100% (10/10), done. From ../update.bundle * tag v2.0 -> FETCH_HEAD Updating c74b792..fea9e6f Fast-forward data3 | 1 + data4 | 1 + data5 | 1 + dataA | 1 + dataB | 1 + dataC | 1 + 6 files changed, 6 insertions(+), 0 deletions(-) create mode 100644 data3 ʢলུʣ
. . . . . . git pull
. . . . . . git pull
. . . . . . git pull • git
pull → Ϛʔδ͕ى͖ΔՄೳੑɻ • ϦϞʔτϦϙδτϦͱͯ͠औΓѻ͏ͷ͕ΊΜ Ͳ͏͍͘͞ɻ FETCH HEAD Λͬͯ࡞ۀ͢Δඞཁ͕͋Δɻ • HEAD ͕ͳ͍߹ɺϦϑΝϨϯεΛࢦఆ͢Δ ඞཁ͕͋Δɻ
. . . . . . git fetch $ git
fetch ../update.bundle fatal: Couldn’t find remote ref HEAD $ git fetch ../update.bundle refs/tags/v2.0 Receiving objects: 100% (19/19), done. Resolving deltas: 100% (10/10), done. From ../update.bundle * tag v2.0 -> FETCH_HEAD
. . . . . . git-fetch
. . . . . . git fetch
. . . . . . git fetch • git
fetch → Ϛʔδى͖ͳ͍ɻ • HEAD ͕ͳ͍߹ɺϦϑΝϨϯεΛࢦఆ͢Δ ඞཁ͕͋Δɻ
. . . . . . git remote $ git
remote add bundle-data ../update.bundle $ git remote update bundle-data Fetching bundle-data From ../bundle-20120228 * [new tag] v2.0 -> v2.0
. . . . . . git remote
. . . . . . git remote
. . . . . . git remote • git
remote → Ϛʔδى͖ͳ͍ • ϦϑΝϨϯεΛࢦఆ͢Δඞཁ͕ͳ ͍ɻ.git/config ͷ refspec ݟͯ͘ΕΔ • remote ʹઃఆ͓͚ͯ࣍͠ճ͔ΒϑΝΠϧ ίϐʔͯ͠ɺgit remote update Ͱ OK • git remote ͍·͠ΐ͏
. . . . . . bundle ΠϝʔδͷऔΓࠐΈ ϩʔΧϧϦϙδτϦʹऔΓࠐΉ߹: •
git pull • git fetch • git remote Λ͏ɻ
. . . . . . ͦͷଞͷίϚϯυ • git bundle
unbundle
. . . . . . git bundle unbundle Git
ΦϒδΣΫτΛ git index-pack Λͬͯ .git/objects ҎԼʹల։͢Δɻ $ git bundle unbundle ../update.bundle Git ΦϒδΣΫτਥޚ༻ୡπʔϧɻ fetch ͳͲඞཁͳͷ͚ͩΛरͬͯల։͢Δɻ
. . . . . . λάϒϥϯνͲ͏͢Δͷʁ • bundle ࡞࣌ʹऔΓࠐΈ͍ͨλάϒϥϯν
Λࢦఆ͢Δ • શͯͷλά --tags Λࢦఆ͢Δ • શͯͷϒϥϯν--branch Λࢦఆ͢Δ • શͯͷϦϑΝϨϯεΛऔΓࠐΈ͍ͨ߹ʹ --all Λࢦఆ͢Δ
. . . . . . λάϒϥϯνͲ͏͢Δͷʁ
. . . . . . λάϒϥϯνͲ͏͢Δͷʁ $ git bundle
create ../update.bundle v1.0..v2.0 \ --tags --branches
. . . . . . λάϒϥϯνͲ͏͢Δͷʁ
. . . . . . ࣅͨΑ͏ͳػೳ git format-patch Ͳ͏
ͳͷʁ • git format-patch : ύονΛ git send-email Ͱ ૹ৴Ͱ͖ΔܗࣜͰग़ྗ͢Δɻ
. . . . . . ࣅͨΑ͏ͳػೳ git format-patch Ͳ͏
ͳͷʁ • git format-patch : ύονΛ git send-email Ͱ ૹ৴Ͱ͖ΔܗࣜͰग़ྗ͢Δɻ : • େྔͷύονͰॲཧͱཧ͕ΊΜͲ͏͘ ͍͞ɻ • ώϡʔϚϯΤϥʔͰଞͷϦϙδτϦͱͷ߹ ੑ͕औΕͳ͘ͳΔՄೳੑ͕͋Δɻ • ϒϥϯνɺλάͳͲΛऔΓѻ͏͜ͱ͕Ͱ͖ ͳ͍ɻ
. . . . . . ͚Ͳɺ͏͜ͱͳΜͯແ͍ΑͶʁ
. . . . . . ͚Ͳɺ͏͜ͱͳΜͯແ͍ΑͶʁ ͔ͩΒϖʔδΔͱ͖ʹফ͞ΕͨΜͩΑ....
. . . . . . ͚Ͳɺ͏͜ͱͳΜͯແ͍ΑͶʁ
. . . . . . ͚Ͳɺ͏͜ͱͳΜͯແ͍ΑͶʁ ·ɺ·͔͞ tar ͰݻΊͯόοΫΞοϓͱ͔ͱ͔
ͬͯͳ͍ΑͶ....
. . . . . . ϦϙδτϦͷόοΫΞοϓ bundle ։࢝ҐஔΛࢦఆ͠ͳ͍߹ɺҰ൪࠷ॳͷί ϛοτ͔Βࢦఆͨ͠ίϛοτ·ͰవΊͯ͘ΕΔɻ
$ git bundle create ../backup.bundle HEAD --all
. . . . . . ϦϙδτϦͷόοΫΞοϓ
. . . . . . ϦϙδτϦͷόοΫΞοϓ
. . . . . . ϦϙδτϦͷόοΫΞοϓ Git ͷ git
ϦϙδτϦΛ όοΫΞοϓͯ͠Έͨɻ ॲཧ/ѹॖํࣜ ॲཧ αΠζ tar/gz 2.207s 37MB tar/xz 22.477s 36MB git bundle 3.531s 27MB
. . . . . . ϦϙδτϦͷόοΫΞοϓ Git ͷ git
ϦϙδτϦΛ όοΫΞοϓͯ͠Έͨɻ ॲཧ/ѹॖํࣜ ॲཧ αΠζ tar/gz 2.207s 37MB tar/xz 22.477s 36MB git bundle 3.531s 27MB git bundle େউརʂ
. . . . . . ·ͱΊ • Git ࢄϦϙδτϦܕ
. . . . . . ·ͱΊ • Git ࢄϦϙδτϦܕ
• Git ϦϙδτϦͷΞΫηεํ๏͕ଟ༷
. . . . . . ·ͱΊ • Git ࢄϦϙδτϦܕ
• Git ϦϙδτϦͷΞΫηεํ๏͕ଟ༷ • εχʔΧωοτϫʔΫରԠ
. . . . . . ·ͱΊ • Git ࢄϦϙδτϦܕ
• Git ϦϙδτϦͷΞΫηεํ๏͕ଟ༷ • εχʔΧωοτϫʔΫରԠ • git bundle ॏཁ • ϦϙδτϦόοΫΞοϓʹ git bundle
. . . . . . ࣭ Կ͔࣭͋Γ·͔͢ʁ