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.3k
「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.6k
Other Decks in Programming
See All in Programming
PHPはいつから死んでいるかの調査
chiroruxx
1
400
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
530
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
380
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
750
Polars入門
daikikatsuragawa
1
100
try! Swift Tokyo 初参加報告LT
hinakko2
0
220
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
670
Git Rebase
bkuhlmann
11
1.6k
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
190
Hanami and htmx
bkuhlmann
0
210
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
2
170
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
14
1.6k
Optimizing for Happiness
mojombo
370
69k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
6
1.5k
Build The Right Thing And Hit Your Dates
maggiecrowley
24
2k
Designing the Hi-DPI Web
ddemaree
276
33k
Fireside Chat
paigeccino
21
2.6k
A designer walks into a library…
pauljervisheath
200
23k
Facilitating Awesome Meetings
lara
42
5.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
What's in a price? How to price your products and services
michaelherold
237
11k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
221
21k
How GitHub (no longer) Works
holman
304
140k
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
. . . . . . ࣭ Կ͔࣭͋Γ·͔͢ʁ