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
ASP.NET Core の OpenAPIサポート
h455h1
0
120
Androidアプリの One Experience リリース
nein37
0
1.2k
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
180
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
1.4k
混沌とした例外処理とエラー監視に秩序をもたらす
morihirok
13
2.3k
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
600
Оптимизируем производительность блока Казначейство
lamodatech
0
960
Rubyでつくるパケットキャプチャツール
ydah
0
180
Azure AI Foundryのご紹介
qt_luigi
1
210
20241217 競争力強化とビジネス価値創出への挑戦:モノタロウのシステムモダナイズ、開発組織の進化と今後の展望
monotaro
PRO
0
290
情報漏洩させないための設計
kubotak
5
1.3k
Featured
See All Featured
The Language of Interfaces
destraynor
155
24k
Statistics for Hackers
jakevdp
797
220k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
How to Ace a Technical Interview
jacobian
276
23k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Optimizing for Happiness
mojombo
376
70k
It's Worth the Effort
3n
183
28k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
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
. . . . . . ࣭ Կ͔࣭͋Γ·͔͢ʁ