-
Notifications
You must be signed in to change notification settings - Fork 1
/
presentation.tex
275 lines (217 loc) · 6.45 KB
/
presentation.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
\documentclass{beamer}
\usepackage{xunicode}
\usepackage{fontspec}
\usepackage{graphicx}
\usepackage[english]{babel}
\renewcommand{\familydefault}{\sfdefault}
\usetheme{CambridgeUS}
%\usecolortheme{beaver}
%\definecolor{titre}{rgb}{0.50,0.00,0.10}
%\setbeamercolor{structure}{fg=titre, bg=white}
\setbeamertemplate{navigation symbols}{}
%\setbeamertemplate{footline}{\hfill\insertframenumber/\inserttotalframenumber}
\AtBeginSection[]
{
\begin{frame}
\frametitle{Questions?}
\end{frame}
\frame{
\frametitle{What now?}
% \tableofcontents[currentsection,hideothersubsections]
\tableofcontents[sectionstyle=show/shaded, subsectionstyle=show/show/hide]
}
}
\title{Git : model and workflows}
\author{Julien Durillon}
\institute{Clever Cloud}
\date{\today}
\begin{document}
\frame{\titlepage}
\frame{
\frametitle{Table of Contents}
\tableofcontents[sectionstyle=show/show, subsectionstyle=hide/hide]
}
\section{Introduction}
\begin{frame}
\frametitle{Introduction}
\begin{itemize}
\item Hard to manage all the commands?
\item What does checkout do ? \pause
\item to revert unstaged changes\pause
\item Set a file in an old state\dots \pause
\item of a commit, of a tag, of a branch
\end{itemize}
\end{frame}
\section{Objects}
\begin{frame}
\frametitle{Git objects}
\framesubtitle{What do they all look like?}
\begin{minipage}{0.5\textwidth}
\begin{center}
\includegraphics[width=0.6\textwidth]{./figures/object.png}
\end{center}
\end{minipage}
\begin{minipage}{0.4\textwidth}
Addressed by a SHA1 identifier calculated from the whole content of the object.
\end{minipage}
\end{frame}
\subsection{User objects}
\begin{frame}
\frametitle{Blobs and Trees}
\framesubtitle{Basically\dots}
\begin{center}
\begin{itemize}
\item A blob is a file
\item A tree is a folder
\end{itemize}
\end{center}
\pause
\begin{center}
\includegraphics[height=0.5\textheight]{./figures/blobandtree.png}
\end{center}
\end{frame}
\subsection{Commits}
\begin{frame}
\frametitle{Commits}
\framesubtitle{Contain}
\begin{itemize}
\item Author \onslide<2->{ -- The one who wrote the code}
\item Commiter \onslide<3->{ -- The one who created the commit object}
\item Parent \onslide<4->{ -- The commit(s) before this one}
\item Tree \onslide<5->{ -- The top tree object of the commited state}
\item Message \onslide<6->{ -- Why the commit was done}
\end{itemize}
\end{frame}
\subsection{Storage}
\begin{frame}[fragile]
\frametitle{Storage}
\framesubtitle{What does .git look like?}
\begin{verbatim}
.git
|-- config
|-- description
|-- HEAD
|-- hooks
|-- info
|-- objects
`-- refs
\end{verbatim}
\end{frame}
\begin{frame}[fragile]
\frametitle{Storage}
\framesubtitle{"We need to go deeper"}
\begin{verbatim}
.git/objects
|-- 10
| `-- 8c8bff3b82234d1726531c6643cbb541d4bc4e
|-- 42
| `-- 0f12c08fcb785df9d8c1887e2545882d6168ea
|-- 5c
| `-- 4b717a0ea3b0c100c5e4141da431014253d44b
|-- info
`-- pack
\end{verbatim}
\pause
\begin{verbatim}
.git/refs
|-- heads
| `-- master
`-- tags
\end{verbatim}
\end{frame}
\subsection{Examples}
\begin{frame}
\frametitle{Example}
\framesubtitle{Plumbing tools}
\begin{itemize}
\item hash-object
\item cat-file
\end{itemize}
\end{frame}
\subsection{Branches, Tags, all that stuff}
\begin{frame}
\frametitle{Only ``labels"}
\framesubtitle{No working tree copy}
A simple project:
\begin{center}
\includegraphics[width=0.5\textwidth]{figures/branches1.png}
\end{center}
\pause
A less simple project:
\begin{center}
\includegraphics[width=0.7\textwidth]{figures/branches2.png}
\end{center}
\end{frame}
\subsection{Back to checkout}
\begin{frame}
\frametitle{Back to checkout}
\begin{center}
Does one thing: get a file/tree in the state of a commit.
\end{center}
\end{frame}
\section{Remotes}
\subsection{Storing the remotes}
\begin{frame}
\frametitle{Storing the remotes}
\begin{itemize}
\item In .git/refs/remotes
\item points to a commit like a branch or a tag
\item can't and shouldn't be changed by other than fetch
\end{itemize}
\end{frame}
\subsection{Understanding the remotes}
\begin{frame}
\frametitle{Understanding remotes}
\begin{center}
\includegraphics[width=0.6\textwidth]{figures/clone.png}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Understanding remotes}
\begin{minipage}{0.5\textwidth}
\includegraphics[width=\textwidth]{figures/after-commit.png}
\end{minipage}
\begin{minipage}{0.4\textwidth}
\footnotesize
\# On branch master\\
\# Your branch is ahead of\\
\# 'origin/master' by 1 commit.\\
\# \\
nothing to commit (working directory clean)
\end{minipage}
\end{frame}
\begin{frame}
\frametitle{Understanding remotes}
\begin{center}
\includegraphics[width=0.6\textwidth]{figures/re-fetch.png}
\end{center}
\end{frame}
\section{Workflows}
\subsection{Basic "recommended" usage}
\begin{frame}
\frametitle{Fully decentralized: the official way}
\begin{center}
\includegraphics[width=0.8\textwidth]{./figures/repo-official.png}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Fully decentralized: limitations}
\begin{center}
\includegraphics[width=0.7\textwidth]{./figures/decent-wf-fail.png}
\end{center}
\end{frame}
\subsection{Centralized: à la Subversion}
\begin{frame}
\frametitle{Centralized: à la Subversion}
\begin{center}
\includegraphics[width=0.5\textwidth]{./figures/svnstyle.png}
\end{center}
\end{frame}
\subsection{Big project: The benevolent dictator}
\begin{frame}
\frametitle{The benevolent dictator}
\begin{center}
\includegraphics[width=0.8\textwidth]{./figures/dictator.png}
\end{center}
\end{frame}
\end{document}