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を使ったQAアプリケーションの作成 - ハンズオン補足資料
oracle4engineer
PRO
3
220
Defying Front-End Inertia: Inertia.js on Rails
skryukov
0
480
メモリウォールを超えて:キャッシュメモリ技術の進歩
kawayu
0
1.9k
プロダクト横断分析に役立つ、事前集計しないサマリーテーブル設計
hanon52_
2
440
PHPで書いたAPIをGoに書き換えてみた 〜パフォーマンス改善の可能性を探る実験レポート〜
koguuum
0
150
The Implementations of Advanced LR Parser Algorithm
junk0612
1
260
アプリを起動せずにアプリを開発して品質と生産性を上げる
ishkawa
0
2.7k
SEAL - Dive into the sea of search engines - Symfony Live Berlin 2025
alexanderschranz
1
130
PHPバージョンアップから始めるOSSコントリビュート / how2oss-contribute
dmnlk
1
1k
PHP で学ぶ OAuth 入門
azuki
1
180
Compose Hot Reload is here, stop re-launching your apps! (Android Makers 2025)
zsmb
1
500
Make Parsers Compatible Using Automata Learning
makenowjust
1
4.4k
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
9
750
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.8k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
It's Worth the Effort
3n
184
28k
Being A Developer After 40
akosma
91
590k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.4k
A Tale of Four Properties
chriscoyier
158
23k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Transcript
. . . . . . ʮGitʹΑΔόʔδϣϯཧʯͷ ࣥචऀʹΑΔGitษڧձ͔ߨԋձ git bundle
ʹ͍ͭͯޠͬͯΈΔ ؠদ ৴༸ iwamatsu@nigauri.org (@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
. . . . . . ࣭ Կ͔࣭͋Γ·͔͢ʁ