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
NISHIO Hirokazu
May 24, 2012
Programming
1
190
Dive into .git 日本語版
社内勉強会で使った資料の日本語版です
NISHIO Hirokazu
May 24, 2012
Tweet
Share
More Decks by NISHIO Hirokazu
See All by NISHIO Hirokazu
Dive into .git
nishio
2
100
Other Decks in Programming
See All in Programming
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
Implementation Patterns
denyspoltorak
0
280
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
970
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
Vibe codingでおすすめの言語と開発手法
uyuki234
0
220
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
Oxlintはいいぞ
yug1224
5
1.3k
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
2026年 エンジニアリング自己学習法
yumechi
0
130
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
Featured
See All Featured
How to Ace a Technical Interview
jacobian
281
24k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
63
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
130
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
72
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
140
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Making Projects Easy
brettharned
120
6.6k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
90
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
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ͳϑΥʔϚοτʹͳ͍ͬͯͳ͍ͷͰղౚͰ ͖ͳ͔ͬͨɻͬ͠ͱखܰͳํ๏͕͋Εڭ͑ ͯԼ͍͞ɻ