introduction.tex 9.47 KB
Newer Older
1 2
\documentclass[slidestop]{beamer}

Mihai's avatar
Mihai committed
3 4
\usepackage{tikz}

Mihai's avatar
Mihai committed
5 6 7 8
\definecolor{break}{rgb}{0,0.5,0}
\definecolor{lecture}{rgb}{0.11,0.27,0.7}
\definecolor{practical}{rgb}{0.94,0.23,0.18}

9 10
\input{../shared/shared.tex}

Mihai's avatar
Mihai committed
11
\author{}
12 13
\title{\courseTitle}
\providecommand{\mySubTitle}{Introduction to Version Control}
14
\providecommand{\myConference}{\courseTitle}
15
\providecommand{\myGroup}{}
Mihai's avatar
Mihai committed
16 17
\providecommand{\myDepartment}{}
\providecommand{\myCenter}{}
18

19 20 21 22 23 24 25 26
\usetheme{lumc}

\begin{document}

% This disables the \pause command, handy in the editing phase.
%\renewcommand{\pause}{}

% Make the title page.
Mihai's avatar
Mihai committed
27
\makeTitleSlide{\includegraphics[width=3.5cm]{images/git_logo.pdf}}
28 29

% First page of the presentation.
Mihai's avatar
Mihai committed
30 31 32 33 34 35 36
\section{Course Outline}
\begin{pframe}
 \vspace{-0.8cm}
 \begin{itemize}
  \item \textcolor{lecture}{Introduction}
  \item \textcolor{lecture}{Git basics}
  \item \textcolor{practical}{Practical 1}
Mihai's avatar
Mihai committed
37
  \item \textcolor{lecture}{The git commit graph}
Mihai's avatar
Mihai committed
38
  \item \textcolor{practical}{Practical 2}
Mihai's avatar
Mihai committed
39 40 41 42
  \item \textcolor{break}{Lunch break}
  \item \textcolor{lecture}{Colaboration: remote repositories}
  \item \textcolor{practical}{Practical 3}
 \end{itemize}
Mihai's avatar
Mihai committed
43 44
 \bigskip
 \url{https://git.lumc.nl/courses/gitcourse}
Mihai's avatar
Mihai committed
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
\end{pframe}

\section{Introduction Outline}
\begin{pframe}
 \begin{itemize}
  \item What is version control?
  \begin{itemize}
   \item Definition
   \item General features
   \item Step by step example
   \item Distributed repositories
   \item Why to use/not use version control?
  \end{itemize}
  \item Git
  \item Web-based remotes
  \begin{itemize}
   \item GitLab vs GitHub
  \end{itemize}

 \end{itemize}
\end{pframe}
Mihai's avatar
Mihai committed
66 67 68

\section{What is version control?}
\subsection{Definition}
69
\begin{pframe}
Mihai's avatar
Mihai committed
70 71 72 73
  \emph{The \textbf{management of changes} to documents, computer programs, large web
        sites, and other collections of information.}\\
  --- \textcolor{darkgray}{\href{https://en.wikipedia.org/wiki/Version_control}{Wikipedia}}
  \\ \\
Mihai's avatar
Mihai committed
74
  \emph{A system that \textbf{records changes} to a file or set of files
Mihai's avatar
Mihai committed
75 76
        over time so that you can recall specific versions later.}\\
  --- \textcolor{darkgray}{\href{https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control}{https://git-scm.com/}}
77

Mihai's avatar
Mihai committed
78 79 80
  \begin{tikzpicture}[remember picture,overlay]
    \node[xshift=-3.3cm,yshift=-7.2cm] at (current page.north east) {\includegraphics[width=4cm]{images/version_control-slide.pdf}};
  \end{tikzpicture}
Mihai's avatar
Mihai committed
81
\end{pframe}
Mihai's avatar
Mihai committed
82

Mihai's avatar
Mihai committed
83 84
\subsection{General features}
\begin{pframe}
Mihai's avatar
Mihai committed
85
  \begin{itemize}
Mihai's avatar
Mihai committed
86 87 88 89 90 91
    \item Keep track of your files in an orderly manner.
    \begin{itemize}
      \item Hide old versions.
      \item Easily access old versions.
      \item Check the differences between current and older versions.
    \end{itemize}
Mihai's avatar
Mihai committed
92 93
  \end{itemize}
  \begin{itemize}
Mihai's avatar
Mihai committed
94
    \item Enables collaboration.
Mihai's avatar
Mihai committed
95 96 97
    \begin{itemize}
     \item Record who made changes and when.
    \end{itemize}
Mihai's avatar
Mihai committed
98
  \end{itemize}
Mihai's avatar
Mihai committed
99
\end{pframe}
Mihai's avatar
Mihai committed
100

Mihai's avatar
Mihai committed
101 102 103 104 105
\subsection{Step by step}
\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_00.pdf}
 \end{center}
Mihai's avatar
Mihai committed
106
\end{pframe}
Mihai's avatar
Mihai committed
107 108 109 110 111

\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_01.pdf}
 \end{center}
Mihai's avatar
Mihai committed
112
\end{pframe}
Mihai's avatar
Mihai committed
113 114 115 116 117

\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_02.pdf}
 \end{center}
Mihai's avatar
Mihai committed
118
\end{pframe}
Mihai's avatar
Mihai committed
119 120 121 122 123

\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_03.pdf}
 \end{center}
Mihai's avatar
Mihai committed
124
\end{pframe}
Mihai's avatar
Mihai committed
125 126 127 128 129

\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_04.pdf}
 \end{center}
Mihai's avatar
Mihai committed
130
\end{pframe}
Mihai's avatar
Mihai committed
131 132 133

\begin{pframe}
 \begin{center}
Mihai's avatar
Mihai committed
134
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_05.pdf}
Mihai's avatar
Mihai committed
135
 \end{center}
Mihai's avatar
Mihai committed
136
\end{pframe}
Mihai's avatar
Mihai committed
137 138 139 140 141

\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_06.pdf}
 \end{center}
Mihai's avatar
Mihai committed
142
\end{pframe}
Mihai's avatar
Mihai committed
143 144 145 146 147

\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_07.pdf}
 \end{center}
Mihai's avatar
Mihai committed
148
\end{pframe}
Mihai's avatar
Mihai committed
149 150 151 152 153

\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_08.pdf}
 \end{center}
Mihai's avatar
Mihai committed
154
\end{pframe}
Mihai's avatar
Mihai committed
155 156 157 158 159

\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_09.pdf}
 \end{center}
Mihai's avatar
Mihai committed
160
\end{pframe}
Mihai's avatar
Mihai committed
161

Mihai's avatar
Mihai committed
162 163 164 165
\begin{pframe}
 \begin{center}
  \includegraphics[width=1\textwidth]{images/vcs_example/vcs_example_10.pdf}
 \end{center}
Mihai's avatar
Mihai committed
166
\end{pframe}
Mihai's avatar
Mihai committed
167

Mihai's avatar
Mihai committed
168 169 170 171 172 173 174
\subsection{Local repository}
\begin{pframe}
 \begin{center}
   \includegraphics[width=\textwidth]{images/vcs_layout_local.pdf}
 \end{center}
\end{pframe}

Mihai's avatar
Mihai committed
175 176 177 178 179 180
% \subsection{Central repository}
% \begin{pframe}
%  \begin{center}
%    \includegraphics[width=\textwidth]{images/vcs_layout_central.pdf}
%  \end{center}
% \end{pframe}
Mihai's avatar
Mihai committed
181 182 183 184 185 186 187 188 189 190 191 192 193 194

\subsection{Distributed repositories}
\begin{pframe}
 \begin{center}
   \includegraphics[width=\textwidth]{images/vcs_layout_distributed.pdf}
 \end{center}
\end{pframe}

\begin{pframe}
 \begin{center}
   \includegraphics[width=\textwidth]{images/vcs_layout_distributed_remotes.pdf}
 \end{center}
\end{pframe}

Mihai's avatar
Mihai committed
195
\subsection{Why should I use it?}
196
\begin{pframe}
Mihai's avatar
Mihai committed
197
  For a single user:
Mihai's avatar
Mihai committed
198
  \begin{itemize}
Mihai's avatar
Mihai committed
199 200 201 202 203 204 205 206 207 208 209 210 211
   \item Revert files to a previous state.
   \item Revert the entire project back to a previous state.
   \item Review changes made over time.
   \item Backup.
  \end{itemize}
  \pause
  For multiple users:
    \begin{itemize}
     \item A reliable way to share files between people/computers.
     \item Allow multiple people working on the same project at the same time.
     \item Conflict resolution.
     \item See who made which changes at which time.
    \end{itemize}
212 213
\end{pframe}

Mihai's avatar
Mihai committed
214
\subsection{Why should I not use it?}
215
\begin{pframe}
Mihai's avatar
Mihai committed
216
  \bigskip
Mihai's avatar
Mihai committed
217

218
  \begin{itemize}
Mihai's avatar
Mihai committed
219
    \item I have my own system.
220 221
  \end{itemize}
  \pause
Mihai's avatar
Mihai committed
222 223 224 225
  \begin{tikzpicture}[remember picture,overlay]
    \node[xshift=-3.4cm,yshift=-5.4cm] at (current page.north east) {\includegraphics[width=6cm]{images/project_tree.pdf}};
  \end{tikzpicture}
\end{pframe}
226

Mihai's avatar
Mihai committed
227 228
\begin{pframe}
  A list of common excuses:
229
  \begin{itemize}
Mihai's avatar
Mihai committed
230 231 232 233 234 235
    \item I have my own system.
    \item It is too much work.
    \item I am the only one working \\ on this project.
    \item This code will not be \\ used by anyone else.
    \item The bugs can be \\ tracked forever.
    \item \ldots
236
  \end{itemize}
Mihai's avatar
Mihai committed
237

Mihai's avatar
Mihai committed
238 239 240
  \begin{tikzpicture}[remember picture,overlay]
    \node[xshift=-3.4cm,yshift=-5.4cm] at (current page.north east) {\includegraphics[width=6cm]{images/project_tree.pdf}};
  \end{tikzpicture}
241
\end{pframe}
242

243
\begin{pframe}
244 245 246
  A list of common excuses:
  \begin{itemize}
    \item I have my own system.
Mihai's avatar
Mihai committed
247 248 249 250
    \item It is too much work.
    \item I am the only one working \\ on this project.
    \item This code will not be \\ used by anyone else.
    \item The bugs can be \\ tracked forever.
251
    \item \ldots
252
  \end{itemize}
Mihai's avatar
Mihai committed
253

254 255
  Eventually leading to:
  \begin{itemize}
256 257
    \item I'm too busy rewriting the code I accidentally deleted.
  \end{itemize}
Mihai's avatar
Mihai committed
258 259 260
  \begin{tikzpicture}[remember picture,overlay]
    \node[xshift=-3.8cm,yshift=-5.6cm] at (current page.north east) {\includegraphics[width=7cm]{images/desperate.pdf}};
  \end{tikzpicture}
261
\end{pframe}
262 263

\section{Git}
264 265
\subsection{The name}
\begin{pframe}
266 267 268 269 270 271
  \emph{Git (n): A person who is deemed to be despicable or contemptible.} ---
  WordNet.
  \bigskip

  \emph{I'm an egotistical bastard, and I name all my projects after myself.
  First ``Linux'', now ``git''.} --- Linus Torvalds.
Mihai's avatar
Mihai committed
272 273 274 275

  \begin{center}
   \includegraphics[width=0.6\textwidth]{images/penguin.pdf}
 \end{center}
276
\end{pframe}
277

278 279
\subsection{History}
\begin{pframe}
280
  Designed to replace the commercial package \emph{BitKeeper}.
281 282 283
  \begin{itemize}
    \item Speed.
    \item Simple design.
Mihai's avatar
Mihai committed
284 285 286 287
    \item Strong support for non-linear development
    \begin{itemize}
     \item Thousands of parallel branches.
    \end{itemize}
288
    \item Fully distributed.
Mihai's avatar
Mihai committed
289
    \item Able to handle large projects like the Linux kernel efficiently.
290
  \end{itemize}
291 292 293 294 295 296
  % The copyright holder of BitKeeper, Larry McVoy, had withdrawn gratis use of
  % the product after claiming that Andrew Tridgell had reverse-engineered the
  % BitKeeper protocols.

  % .. version 4.1, released in June 2015, has grown to over 19.5 million lines
  % of code contributed by almost 14,000 programmers.
297
\end{pframe}
298

Mihai's avatar
Mihai committed
299 300 301 302 303 304 305 306 307 308 309 310
\subsection{Installation}
\begin{pframe}
 \begin{itemize}
  \item Linux
  \begin{itemize}
   \item \lstinline{sudo apt-get install git} (Ubuntu)
   \item \lstinline{sudo yum install git} (Fedora)
  \end{itemize}
  \item Windows
  \begin{itemize}
   \item git-scm.com/download/win
  \end{itemize}
Mihai's avatar
Mihai committed
311
  \item Mac
Mihai's avatar
Mihai committed
312 313 314 315
  \begin{itemize}
   \item git-scm.com/mac
  \end{itemize}
 \end{itemize}
Mihai's avatar
Mihai committed
316

Mihai's avatar
Mihai committed
317
 Once installed you can check Git version:
Mihai's avatar
Mihai committed
318 319 320 321 322 323 324
 \begin{itemize}
  \item \lstinline{git --version}
 \end{itemize}

\end{pframe}


325
\section{Remotes}
Mihai's avatar
Mihai committed
326
\subsection{Web-based}
327
\begin{pframe}
Mihai's avatar
Mihai committed
328 329 330
 \begin{center}
   \includegraphics[width=\textwidth]{images/central_remotes.pdf}
 \end{center}
331 332 333
\end{pframe}

\begin{pframe}
Mihai's avatar
Mihai committed
334 335 336
 \begin{center}
   \includegraphics[width=\textwidth]{images/central_remotes_01.pdf}
 \end{center}
337
\end{pframe}
338

339
\begin{pframe}
Mihai's avatar
Mihai committed
340
  GitHub:
341
  \begin{itemize}
Mihai's avatar
Mihai committed
342 343
    \item Free for public repositories. Paid for private ones.
    \item Hosting provided for free.
344
  \end{itemize}
Mihai's avatar
Mihai committed
345
  \bigskip
346

Mihai's avatar
Mihai committed
347 348 349 350 351 352
  GitLab:
  \begin{itemize}
    \item Self hosting - own installation.
    \item No hosting provided.
    \item Basic features for free. Paid advanced ones.
  \end{itemize}
353
\end{pframe}
354

355 356 357 358 359
\makeAcknowledgementsSlide{
  \begin{tabular}{l}
    \acknowledgements
  \end{tabular}
  \bigskip
360

361
  \hfill\includegraphics[width=3.5cm]{git_logo}
362

363 364 365 366
  \begin{tabular}{l}
    \small\url{https://git.lumc.nl/humgen/gitcourse}
  \end{tabular}
}
367

368
\end{document}