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
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
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
関数型プログラミングのメリットって何だろう?
wanko_it
0
120
才能?センス?知らん、 続けたもん勝ちだ。-- 結婚・出産・癌を越えてなお、私がプロダクトを創り続ける理由
16bitidol
2
680
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
200
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
340
継続モナドとリアクティブプログラミング
yukikurage
1
230
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
320
The NotImplementedError Problem in Ruby
koic
1
1.1k
セキュリティの専門家じゃなくてもできる。「セキュリティ意識」をアップデートして サプライチェーン攻撃への耐性を高めよう。
tk3fftk
5
1k
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
210
AIで効率化できた業務・日常
ochtum
0
160
OS アップデート対応の取り組み方がもっと共有されてほしい
andpad
0
110
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
400
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
Typedesign – Prime Four
hannesfritz
42
3.1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
Building Applications with DynamoDB
mza
96
7.1k
Embracing the Ebb and Flow
colly
88
5.1k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
410
We Are The Robots
honzajavorek
0
270
Navigating Team Friction
lara
192
16k
Prompt Engineering for Job Search
mfonobong
0
370
Building Adaptive Systems
keathley
44
3.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
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Λ͏ͷ ָ͕͘͠ͳΔ͔
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠