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
Dive into .git 日本語版
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
NISHIO Hirokazu
May 24, 2012
Programming
190
1
Share
Dive into .git 日本語版
社内勉強会で使った資料の日本語版です
NISHIO Hirokazu
May 24, 2012
More Decks by NISHIO Hirokazu
See All by NISHIO Hirokazu
Dive into .git
nishio
2
110
Other Decks in Programming
See All in Programming
20260320登壇資料
pharct
0
170
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
240
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
190
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
2.3k
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
220
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
150
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
3
520
「速くなった気がする」をデータで疑う
senleaf24
0
150
ファインチューニングせずメインコンペを解く方法
pokutuna
0
290
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
220
AIエージェントで業務改善してみた
taku271
0
500
Redox OS でのネームスペース管理と chroot の実現
isanethen
0
560
Featured
See All Featured
Amusing Abliteration
ianozsvald
1
150
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
200
Context Engineering - Making Every Token Count
addyosmani
9
810
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
The SEO identity crisis: Don't let AI make you average
varn
0
440
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
260
WENDY [Excerpt]
tessaabrams
9
37k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
210
YesSQL, Process and Tooling at Scale
rocio
174
15k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
350
Discover your Explorer Soul
emna__ayadi
2
1.1k
Transcript
%JWFJOUPHJU ඌହ
BCPVU w ͜ͷεϥΠυࣾษڧձͰؒͰ HJUͷதΛݟͯΈΔσϞΛ͢ΔͨΊʹ Ξϯνϣίͱͯ͠࡞ΒΕͨͷͰ͢ɻ w ϖʔδεϥΠυͰҹ͢ΔͱຕͰ ऩ·ΔͷͰͪΐ͏Ͳ͍͍͔ͱࢥ͍·͢ɻ
(JUΑ͘Θ͔ΒΜʁ w ʮ(JUͷ͍ΖΜͳ֓೦͕͍͠ʯʁ w ͡Ό͋֓೦ஔ͍ͱ͍ͯɺ ʮཧతʹͲ͏ͳͬͯΜͷʁʯ Λ֬ೝͯ͠ΈΑ͏ʂ w (JU͕ͲΜͳͷ͔Πϝʔδ͘͢͠ͳΕ͍
$ mkdir test $ cd test $ ls -a .
.. $ git init Initialized empty Git repository in .../test/.git/ HJUJOJUUFTUͰ0, छֻ͚ͳ͍ͨͩͷ ۭͷσΟϨΫτϦΛ࡞Δ ࣮ݧ༻ͷϦϙδτϦΛ࡞Δ ˡͰ͖ͨʂ
$ ls -a . .. .git ϦϙδτϦ͕Ͱ͖ͨʂ
தΛݟͯΈΑ͏ $ cd .git $ tree . |-- HEAD |--
config |-- description |-- hooks |-- info | `-- exclude |-- objects | |-- info | `-- pack `-- refs |-- heads `-- tags IPPLTͷதলུͨ͠
$ cd .. $ touch README $ git add README
$ git commit -m “initial commit” [master (root-commit) 4dd66d3] initial commit ίϛοτͨ͠Β Կ͕มΘΔʁ
PCKFDUT͕૿͑ͨ $ tree .git/objects .git/objects |-- 4d | `-- d66d3a32a66f3578317717ccfb18
|-- 54 | `-- 3b9bebdc6bd5c4b22136034a95dd |-- e6 | `-- 9de29bb2d1d6434b8b29ae775ad8 |-- info `-- pack ͍ϑΝΠϧ໊ͷඌলུͨ͠ ଞʹมΘΔ෦͕͋Δ͕ࠓճׂѪ
$ cat > show.py #!/usr/bin/env python import sys import zlib
data = file(sys.argv[1], "rb").read() data = zlib.decompress(data) print repr(data) தΛݟͯΈΑ͏ʂ දࣔεΫϦϓτΛ࡞Δ ҎԼͰTIPXQZɻDINPE YΛΕͣʹ
$PNNJUͷத $ ./show.py .git/objects/4d/d6... 'commit 201\x00 tree 543b...\n author NISHIO
Hirokazu <...> 1337655529 +0900\n committer NISHIO Hirokazu <...> 1337655529 +0900\n \n initial commit\n' దʹվߦΛೖΕͨ USFFCʹ ϋογϡίϛοτ࣌ͷϝοηʔδʹදࣔ͞Ε͍ͯΔ
5SFFͷத $ ./show.py 54/3b... 'tree 34\x00 100644 README\x00 \xe6\x9d\xe2\x9b...' దʹվߦΛೖΕͨ
FCʹ
#MPCͷத $ ./show.py e6/9d... 'blob 0\x00' ͜Ε͕3&"%.&ͷத ࠓۭͳͷͰαΠζ͕ aYͷޙʹԿͳ͍
ϑΝΠϧ໊ $ python -c “import hashlib; hashlib.sha1('blob 0\x00').hexdigest()” 'e69de29b...' ࣮தͷ4)"ϋογϡʂ
·ͱΊ w ϦϙδτϦHJUͷதʹೖ͍ͬͯΔ w HJUPCKFDUTʹɺTIBϋογϡΛ໊લʹ͠ɺ Λ[MJCͰѹॖͯ͠ɺ͍Ζ͍Ζೖ͍ͬͯΔ w ʮ͍Ζ͍ΖʯͷதʹDPNNJUΦϒδΣΫτɺ USFFΦϒδΣΫτɺCMPCΦϒδΣΫτ w
ࠓճUBHSFGTͷׂѪ ࣍ճʁ
ͬͯΈΑ͏ w 3&"%.&Λฤूͯ͠Ͳ͏มΘΔ͔؍͠Α͏ w ৽͍͠DPNNJUΦϒδΣΫτʹ ʮQBSFOUϋογϡʯͷߦ͕͋Δ w ৽͍͠CMPCʹ3&"%.&ͷ༰͕ೖ͍ͬͯΔ w ৽͍͠ϑΝΠϧΛՃͯ͠ΈΑ͏ɻ5SFFͲ͏
มΘΔʁ w ϑΝΠϧʹهͨ͠ΒʁCMPCࠩʁશମʁ
None
͓·͚ w HJUTIPXGPSNBUSBX͕ͥΜͥΜSBX ͡Όͳ͍ͯ͘ͷʹͳΒͳ͍
தΛݟͯΈΑ͏ $ git show --format=raw 4dd6 commit 4dd66d3a32a66f3578317717ccfb1876d43034ea tree 543b9bebdc6bd5c4b22136034a95dd097a57d3dd
author NISHIO Hirokazu <...> 1337138246 +0900 committer NISHIO Hirokazu <...> 1337138246 +0900 initial commit diff --git a/README b/README new file mode 100644 index 0000000..e69de29 ϝʔϧΞυϨεলུͨ͠
5SFFͷத $ git show --format=raw 543b tree 543b README
#MPCͷத Կදࣔ͞Εͳ͍ $ git show --format=raw e69d
͓͔͍͠ ͜Εͷத͕FE ͩͱ͍͏ใͲ͜ʁ $ git show --format=raw 543b tree 543b
README ͱ͍͏Θ͚ͰදࣔεΫϦϓτΛ࡞ͬͨ
2" w 2εΫϦϓτ࡞Βͳͯ͘HVO[JQͱ͔Ͱղౚ͢ Εྑ͍ͷͰʁ w "[MJCͰѹॖ͞Ε͍ͯΔ͕ɺ[JQϑΝΠϧͱͯ͠ WBMJEͳϑΥʔϚοτʹͳ͍ͬͯͳ͍ͷͰղౚͰ ͖ͳ͔ͬͨɻͬ͠ͱखܰͳํ๏͕͋Εڭ͑ ͯԼ͍͞ɻ