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
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
A1
April 24, 2017
Programming
330
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
内部構造から学ぶGit
社内勉強会資料
A1
April 24, 2017
More Decks by A1
See All by A1
プロダクトのことは何でもNotebookLMに聞こう / NotebookLM for on boarding
eichisanden
2
150
Kotlin2でdataクラスの copyメソッドを禁止する/Data class copy function to have the same visibility as constructor
eichisanden
1
1k
短納期でローンチした新サービスをJavaで開発した話/launched new service using Java
eichisanden
6
4.3k
トラブルゼロで乗り切ったTypeScript移行/trouble-free TypeScript migration
eichisanden
3
3.7k
スクラム開発チームをLessでスケールさせた話/Scaling Scrum team with Less
eichisanden
0
6.3k
息の長いサービスのフロントエンドを少し改善する営み/frontend-improvement
eichisanden
3
3.1k
実はGitLabで使えるmermaid.js/gitlab-mermaid.js
eichisanden
1
840
既存 Web アプリケーションへの React.js 適用/react for web application
eichisanden
0
1.9k
楽楽明細でやってるChatOps/Development with ChatOps
eichisanden
0
1.2k
Other Decks in Programming
See All in Programming
The NotImplementedError Problem in Ruby
koic
1
610
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
4.2k
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
3.5k
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.9k
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
320
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
140
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
190
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
230
AIエージェントの隔離技術の徹底比較
kawayu
0
460
AI時代のUIはどこへ行く?その2!
yusukebe
19
6.7k
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
3Dシーンの圧縮
fadis
1
660
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
160
For a Future-Friendly Web
brad_frost
183
10k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
200
Google's AI Overviews - The New Search
badams
0
1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
71
40k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
Transcript
෦ߏ͔ΒֶͿGit @eichisanden
f5aecbff04f484dcf74e14f c6961da0a8b6d43ad
Gitͱ͍͑ɺSha1ϋογϡ40ܻ
commit ff86faf2fa02bc21933c9e1dcc75c8d81b3e104a Merge: 8f8d0ec 552a736 Author: Taro <
[email protected]
> Date: Wed
Aug 19 14:49:37 2015 -0700 Bugfix xxx commit 8f8d0ecfde871144ae839876039fe4e8fed75a9c Author: Taro <
[email protected]
> Date: Wed Aug 19 14:46:09 2015 -0700 Refactoring xxx commit 011710a315a5e4157e882880fe77798f8d4adde0 Merge: 8c9155e 09bb652 Author: Taro <
[email protected]
> Date: Wed Aug 19 14:48:56 2015 -0700 Merge branch 'todo' git logͷ݁Ռ
Q. ԿͰsha1ϋογϡͳͷʁ svnΈ͍ͨʹγʔέϯεͷํ͕ྑ͘ͳ ͘ͳ͍ʁ
A. GitDVCSʢࢄܕόʔ δϣϯཧγεςϜʣ͔ͩΒ
ϦϏδϣϯ1ͬͯԿΑ தԝϦϙδτϦ "͞ΜͷϩʔΧϧ #͞ΜͷϩʔΧϧ →ࢄڥશମͰϢχʔΫͰ͋Δඞཁ͕͋Δ
ࢄܕ͡Όͳ͔ͬͨͱͯ͠ɺ Gitίϛοτͷྺ࢙ͷվมʹ༰ ͳͷͰɺγʔέϯεNo.߹Θͳ͍
Q. ຖ40ܻࢦఆ͠ͳ͍ͱμϝͳ ͷʁ
A. ඃΒͳ͚Εɺઌ಄4ܻͰOK େ͖ΊͷϦϙδτϦͰ6ܻࢦఆͰ͍͚Δ
Q. ϋογϡͲ͏ܾͬͯ·Δ ͷʁ
A. ίϛοτͷ༰Ͱܾ·Δ
Q. ϋογϡ͕ඃΔ͡Όͳ͍ʁ
A. ඃΔʢՄೳੑ͋Δʣ
ͰিಥͷՄೳੑҰஹೋઍԯͷͦ ͷ·ͨҰஹഒ
ٿ্ͷཻ࠭ͷઍೋඦഒͷ֬ ʙPro Git 6ষΑΓʙ
ී௨ʹ͏ʹؾʹ͢Δඞཁͳ͍
gitͷΦϒδΣΫτͷछྨ commit tree blob tagʢࠓճ͠·ͤΜʣ
Πϝʔδਤ HJUMPHͰΈͯͨͷ ͜͜ͷҰཡ
Πϝʔδਤ ଞͷΦϒδΣΫτҰҙͳϋο γϡΛ͍࣋ͬͯΔ
git cat-file ίϚϯυͰΦϒδΣΫ τͷதΛ͍ͯΈΑ͏
commitΦϒδΣΫτ $ git cat-file -p ff86fa tree c95970c3507b89fe43181df983f73c8f1db262fb parent 8f8d0ecfde871144ae839876039fe4e8fed75a9c
parent 552a736de775994570570a0514f24e32686afbe0 author Taro <
[email protected]
> 1440020977 -0700 committer Taro <
[email protected]
> 1440020977 -0700 Bugfix: xxx
treeΦϒδΣΫτ $ git cat-file -p c95970 100644 blob 5e98806c6cc246acef5f539ae191710a0c06ad3f .gitattributes
100644 blob a685ec1fb0ca49607431a65f1ccf035bb9b95a3a .gitignore 100644 blob ece2951a2b1e1cdd611c7dc371e50501d416d1f8 .mailmap 100644 blob 536e55524db72bd2acf175208aef4f3dfc148d42 COPYING 040000 tree dbb0cc4bf1e93167118aa39e57c8b7efa9113598 Documentation 100755 blob fc45283501a3b004edabc55781b486b37509dd37 GIT-VERSION-GEN ϑΝΠϧͱϑΥϧμͷใΛ อ͍࣋ͯ͠Δɻ
blobΦϒδΣΫτ $ git cat-file -p 4223f1 package main import “fmt”
fun main() { fmt.Printf(“Hello World”) } ಡΊΔʂಡΊΔͧʂʂ
Q. GitͷΦϒδΣΫτͲ͜ʹอଘ ͞Ε͍ͯΔͷʁ
A. .gitϑΥϧμͷத
GitͷϑΥϧμߏ .git !"" HEAD ←HEAD͕Ͳ͜Λࢦ͍ࣔͯ͠͠Δ !"" config ←จࣈ௨ΓઃఆϑΝΠϧ !"" description
!"" hooks ←hookεΫϦϓτ !"" info # %"" exclude !"" objects ←͜͜ʹΦϒδΣΫτ͕ೖ͍ͬͯΔ # !"" 22 # # %"" 62de0c121f22df8e78f5a37d6e114fd322c0b0 # !"" 3e # # %"" 2799e0729c58acb86bb40f19c8cb4b2b4f8e96 # !"" 46 # # %"" d2987acc571a47f9e69b585eb833f6e903b2cc # !"" 6c # # %"" c84aae39643fdb94d1699b74b07e2c6500cbaf # !"" info # %"" pack %"" refs !"" heads %"" tags 8 directories, 13 files
Q. શ͘ಉ͡༰ͷϑΝΠϧ͕͋ͬͨ ΒΦϒδΣΫτͲͷΑ͏ʹ֨ೲ͞ ΕΔͷʁ
ಉ͡༰ͷϑΝΠϧΛ࡞ͯ͠ΈΔ $ echo "hoge" > a.txt $ echo "hoge" >
b.txt $ git add . $ git commit -m 'add a.txt and b.txt' [master (root-commit) 6cc84aa] add a.txt and b.txt 2 files changed, 2 insertions(+) create mode 100644 a.txt create mode 100644 b.txt $ git cat-file -p 6cc84aa tree f5aecbff04f484dcf74e14fc6961da0a8b6d43ad author eichisanden <
[email protected]
> 1440425753 +0900 committer eichisanden <
[email protected]
> 1440425753 +0900 add a.txt and b.txt $ git cat-file -p f5aecbff 100644 blob 2262de0c121f22df8e78f5a37d6e114fd322c0b0 a.txt 100644 blob 2262de0c121f22df8e78f5a37d6e114fd322c0b0 b.txt $ git cat-file -p 2262 hoge ϋογϡಉ͡ͳͷͰແବͳΦ ϒδΣΫτ࡞ΒΕͳ͍ʂ
ϑΝΠϧ໊͕ҧ͓͏͕ɺ อଘϑΥϧμ͕ҧ͓͏͕ɺ ༰͕ಉ͡ͳΒಉ͡ϋογϡʹͳΔʂ
ϋογϡ͕িಥͨ͠ͱ͖Git ಉ͡ಈ͖Λ͢Δͣ ʢલड़ͷ௨Γɺى͜Γಘͳ͍Ͱ͕͢ʣ
Q. ϑΝΠϧΛࠩͰཧ͠ͳ͍ͱɺ ͑Β͍༰ྔΛ৯͏ͷͰʁ
͔֬ʹcommit(git add)ͨ͠ ޙ༰ྔΛ৯͏
ͨͩɺGCͰpackfileʹҠಈ͞Ε༰ྔݮΔͷͰେৎ .git !"" HEAD ←HEAD͕Ͳ͜Λࢦ͍ࣔͯ͠͠Δ !"" config ←จࣈ௨ΓઃఆϑΝΠϧ !"" description
!"" hooks ←hookεΫϦϓτ !"" info # %"" exclude !"" objects # !"" 22 # # %"" 62de0c121f22df8e78f5a37d6e114fd322c0b0 # !"" 3e # # %"" 2799e0729c58acb86bb40f19c8cb4b2b4f8e96 # !"" 46 # # %"" d2987acc571a47f9e69b585eb833f6e903b2cc # !"" 6c # # %"" c84aae39643fdb94d1699b74b07e2c6500cbaf # !"" info # %"" pack ←͜͜ʹҠಈ͞ΕΔ %"" refs !"" heads %"" tags 8 directories, 13 files
໌ࣔతʹgit gcίϚϯυΛଧͨͳͯ͘ɺ git pushͱ͔ͷλΠϛϯάͰউखʹͬ ͯ͘ΕΔͷͰɺීஈҙࣝ͠ͳͯ͘OK
෦ߏΛΔͱgitΛ͏ͷ ָ͕͘͠ͳΔ͔
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠