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

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

Mihai Lefter's avatar
Mihai Lefter 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}

Laros's avatar
Laros committed
9 10
\input{../shared/shared.tex}

Mihai Lefter's avatar
Mihai Lefter committed
11
\author{}
Laros's avatar
Laros committed
12 13
\title{\courseTitle}
\providecommand{\mySubTitle}{Introduction to Version Control}
Laros's avatar
Laros committed
14
\providecommand{\myConference}{\courseTitle}
Laros's avatar
Laros committed
15
\providecommand{\myGroup}{}
Mihai Lefter's avatar
Mihai Lefter committed
16 17
\providecommand{\myDepartment}{}
\providecommand{\myCenter}{}
Laros's avatar
Laros committed
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 Lefter's avatar
Mihai Lefter committed
27
\makeTitleSlide{\includegraphics[width=3.5cm]{images/git_logo.pdf}}
28 29

% First page of the presentation.
Mihai Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter committed
37
  \item \textcolor{lecture}{The git commit graph}
38
  \item \textcolor{practical}{Practical 2}
Mihai Lefter's avatar
Mihai Lefter committed
39 40 41 42
  \item \textcolor{break}{Lunch break}
  \item \textcolor{lecture}{Colaboration: remote repositories}
  \item \textcolor{practical}{Practical 3}
 \end{itemize}
43 44
 \bigskip
 \url{https://git.lumc.nl/courses/gitcourse}
Mihai Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter committed
66 67 68

\section{What is version control?}
\subsection{Definition}
Laros's avatar
Laros committed
69
\begin{pframe}
Mihai Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter committed
74
  \emph{A system that \textbf{records changes} to a file or set of files
Mihai Lefter's avatar
Mihai Lefter 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/}}
Laros's avatar
Laros committed
77

Mihai Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter committed
81
\end{pframe}
Mihai Lefter's avatar
Mihai Lefter committed
82

Mihai Lefter's avatar
Mihai Lefter committed
83 84
\subsection{General features}
\begin{pframe}
Mihai Lefter's avatar
Mihai Lefter committed
85
  \begin{itemize}
Mihai Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter committed
92 93
  \end{itemize}
  \begin{itemize}
Mihai Lefter's avatar
Mihai Lefter committed
94
    \item Enables collaboration.
Mihai Lefter's avatar
Mihai Lefter committed
95 96 97
    \begin{itemize}
     \item Record who made changes and when.
    \end{itemize}
Mihai Lefter's avatar
Mihai Lefter committed
98
  \end{itemize}
Mihai Lefter's avatar
Mihai Lefter committed
99
\end{pframe}
Mihai Lefter's avatar
Mihai Lefter committed
100

Mihai Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter committed
106
\end{pframe}
Mihai Lefter's avatar
Mihai Lefter committed
107 108 109 110 111

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

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

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

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

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

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

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

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

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

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

Mihai Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter committed
195
\subsection{Why should I use it?}
Laros's avatar
Laros committed
196
\begin{pframe}
Mihai Lefter's avatar
Mihai Lefter committed
197
  For a single user:
Mihai Lefter's avatar
Mihai Lefter committed
198
  \begin{itemize}
Mihai Lefter's avatar
Mihai Lefter 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}
Laros's avatar
Laros committed
212 213
\end{pframe}

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

Laros's avatar
Laros committed
218
  \begin{itemize}
Mihai Lefter's avatar
Mihai Lefter committed
219
    \item I have my own system.
Laros's avatar
Laros committed
220 221
  \end{itemize}
  \pause
Mihai Lefter's avatar
Mihai Lefter 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}
Laros's avatar
Laros committed
226

Mihai Lefter's avatar
Mihai Lefter committed
227 228
\begin{pframe}
  A list of common excuses:
Laros's avatar
Laros committed
229
  \begin{itemize}
Mihai Lefter's avatar
Mihai Lefter 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
Laros's avatar
Laros committed
236
  \end{itemize}
Mihai Lefter's avatar
Mihai Lefter committed
237

Mihai Lefter's avatar
Mihai Lefter 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}
Laros's avatar
Laros committed
241
\end{pframe}
Laros's avatar
Laros committed
242

Laros's avatar
Laros committed
243
\begin{pframe}
Laros's avatar
Laros committed
244 245 246
  A list of common excuses:
  \begin{itemize}
    \item I have my own system.
Mihai Lefter's avatar
Mihai Lefter 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.
Laros's avatar
Laros committed
251
    \item \ldots
Laros's avatar
Laros committed
252
  \end{itemize}
Mihai Lefter's avatar
Mihai Lefter committed
253

Laros's avatar
Laros committed
254 255
  Eventually leading to:
  \begin{itemize}
Laros's avatar
Laros committed
256 257
    \item I'm too busy rewriting the code I accidentally deleted.
  \end{itemize}
Mihai Lefter's avatar
Mihai Lefter 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}
Laros's avatar
Laros committed
261
\end{pframe}
Laros's avatar
Laros committed
262 263

\section{Git}
Laros's avatar
Laros committed
264 265
\subsection{The name}
\begin{pframe}
Laros's avatar
Laros committed
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 Lefter's avatar
Mihai Lefter committed
272 273 274 275

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

Laros's avatar
Laros committed
278 279
\subsection{History}
\begin{pframe}
Laros's avatar
Laros committed
280
  Designed to replace the commercial package \emph{BitKeeper}.
Laros's avatar
Laros committed
281 282 283
  \begin{itemize}
    \item Speed.
    \item Simple design.
Mihai Lefter's avatar
Mihai Lefter committed
284 285 286 287
    \item Strong support for non-linear development
    \begin{itemize}
     \item Thousands of parallel branches.
    \end{itemize}
Laros's avatar
Laros committed
288
    \item Fully distributed.
Mihai Lefter's avatar
Mihai Lefter committed
289
    \item Able to handle large projects like the Linux kernel efficiently.
Laros's avatar
Laros committed
290
  \end{itemize}
Laros's avatar
Laros committed
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.
Laros's avatar
Laros committed
297
\end{pframe}
Laros's avatar
Laros committed
298

Mihai Lefter's avatar
Mihai Lefter 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 Lefter's avatar
Mihai Lefter committed
311
  \item Mac
Mihai Lefter's avatar
Mihai Lefter committed
312 313 314 315
  \begin{itemize}
   \item git-scm.com/mac
  \end{itemize}
 \end{itemize}
Mihai Lefter's avatar
Mihai Lefter committed
316

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

\end{pframe}


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

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

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

Mihai Lefter's avatar
Mihai Lefter 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}
Laros's avatar
Laros committed
353
\end{pframe}
Laros's avatar
Laros committed
354

Laros's avatar
Laros committed
355 356 357 358 359
\makeAcknowledgementsSlide{
  \begin{tabular}{l}
    \acknowledgements
  \end{tabular}
  \bigskip
360

Laros's avatar
Laros committed
361
  \hfill\includegraphics[width=3.5cm]{git_logo}
Laros's avatar
Laros committed
362

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

368
\end{document}