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
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
110
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
370
Running Swift without an OS
kishikawakatsumi
0
730
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
640
PHPで TLSのプロトコルを実装してみる
higaki_program
0
750
車輪の再発明をしよう!PHP で実装して学ぶ、Web サーバーの仕組みと HTTP の正体
h1r0
3
510
20260320登壇資料
pharct
0
170
安いハードウェアでVulkan
fadis
1
940
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
110
10 Tips of AWS ~Gen AI on AWS~
licux
5
200
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
550
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
190
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.2k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.1k
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
880
Mind Mapping
helmedeiros
PRO
1
150
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
480
GitHub's CSS Performance
jonrohan
1032
470k
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ͳϑΥʔϚοτʹͳ͍ͬͯͳ͍ͷͰղౚͰ ͖ͳ͔ͬͨɻͬ͠ͱखܰͳํ๏͕͋Εڭ͑ ͯԼ͍͞ɻ