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
340
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
1.1k
短納期でローンチした新サービスをJavaで開発した話/launched new service using Java
eichisanden
6
4.3k
トラブルゼロで乗り切ったTypeScript移行/trouble-free TypeScript migration
eichisanden
3
3.8k
スクラム開発チームをLessでスケールさせた話/Scaling Scrum team with Less
eichisanden
0
6.4k
息の長いサービスのフロントエンドを少し改善する営み/frontend-improvement
eichisanden
3
3.2k
実はGitLabで使えるmermaid.js/gitlab-mermaid.js
eichisanden
1
850
既存 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
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
180
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
160
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
210
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
140
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
470
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
220
React本体のコードリーディング
high_g_engineer
1
140
freeeにおけるEvalsの実践例の紹介
freee
PRO
0
110
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
680
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
270
the container ship “Apple Silicon”@WWDC26 Recap -Japan-\(region).swift
shingangan
0
120
【やさしく解説 設計編・中級 #4】ルールの寿命と、システムの年輪
panda728
PRO
2
180
Featured
See All Featured
Darren the Foodie - Storyboard
khoart
PRO
3
3.6k
Navigating Weather and Climate Data
rabernat
0
470
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Music & Morning Musume
bryan
47
7.3k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Code Review Best Practice
trishagee
74
20k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
280
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
240
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
A Modern Web Designer's Workflow
chriscoyier
698
190k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
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Λ͏ͷ ָ͕͘͠ͳΔ͔
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠