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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.3k
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
850
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
260
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.9k
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
100
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
530
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.3k
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
130
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
200
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
120
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
150
Claspは野良GASの夢をみるか
takter00
0
180
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Done Done
chrislema
186
16k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
580
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Ethics towards AI in product and experience design
skipperchong
2
310
Game over? The fight for quality and originality in the time of robots
wayneb77
1
190
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
200
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Λ͏ͷ ָ͕͘͠ͳΔ͔
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠