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.6k
「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
AIコーディングエージェントを 「使いこなす」ための実践知と現在地 in ログラス / How to Use AI Coding Agent in Loglass
rkaga
4
1.2k
eBPF超入門「o11yに使える」とは (20250424_eBPF_o11y)
thousanda
1
110
Amazon CloudWatchの地味だけど強力な機能紹介!
itotsum
0
230
flutter_kaigi_mini_4.pdf
nobu74658
0
140
読書シェア会 vol.4 『ダイナミックリチーミング 第2版』
kotaro666
0
110
Instrumentsを使用した アプリのパフォーマンス向上方法
hinakko
0
230
generative-ai-use-cases(GenU)の推しポイント ~2025年4月版~
hideg
1
380
ウォンテッドリーの「ココロオドル」モバイル開発 / Wantedly's "kokoro odoru" mobile development
kubode
1
270
カオスに立ち向かう小規模チームの装備の選択〜フルスタックTSという装備の強み _ 弱み〜/Choosing equipment for a small team facing chaos ~ Strengths and weaknesses of full-stack TS~
bitkey
1
130
生成AIで知るお願いの仕方の難しさ
ohmori_yusuke
1
100
Making TCPSocket.new "Happy"!
coe401_
1
3.1k
M5UnitUnified 最新動向 2025/05
gob
0
130
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
298
20k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.7k
Bash Introduction
62gerente
612
210k
Writing Fast Ruby
sferik
628
61k
A Tale of Four Properties
chriscoyier
159
23k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
5
590
Practical Orchestrator
shlominoach
187
11k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.4k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
33k
Become a Pro
speakerdeck
PRO
28
5.3k
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
. . . . . . ࣭ Կ͔࣭͋Γ·͔͢ʁ