9cbbe7ffb686fc1895a0eb8a0bc260790438b20d
[ai-gitflashtalk.git] / git.tex
1 %&preamble
2 \begin{document}
3
4 \frame{\titlepage}
5
6 \begin{frame}
7 \frametitle{Table of contents}
8 \tableofcontents
9 \end{frame}
10
11 \section{Introduction}
12 \begin{frame}
13 \frametitle{Who am I?}
14 \begin{itemize}
15 \item Mart Lubbers
16 \item 4th year bachelor AI
17 \item \url{https://github.com/dopefishh/gitflashtalk}
18 \item SHA of the commit of this presentation:
19 {\tiny\GITAbrHash}
20 \end{itemize}
21 \end{frame}
22
23 \begin{frame}
24 \frametitle{Where did GIT come from?}
25 \begin{block}{History}
26 \begin{columns} \column{0.4\linewidth}
27 \begin{itemize}
28 \item Pronounce: \textipa{[g\'\i t]}
29 \item Linus Thorvalds
30 \item Linux kernel
31 \end{itemize}
32
33 \column{0.5\linewidth}
34 \begin{figure}[H]
35 \centering
36 \includegraphics[width=0.5\linewidth]{1.png}
37 \caption{Linus Torvalds}
38 \end{figure}
39 \end{columns}
40 \end{block}
41
42 \begin{block}{What is GIT?}
43 \begin{itemize}
44 \item Version control
45 \end{itemize}
46 \end{block}
47 \end{frame}
48
49 \begin{frame}
50 \frametitle{Why GIT?}
51 \begin{block}{Pros}
52 \begin{itemize}
53 \item Fast
54 \item Scaleable
55 \item Simple
56 \item Support for non linear development
57 \item Intermediate stage between committing and pushing
58 \end{itemize}
59 \end{block}
60
61 \begin{block}{Cons}
62 \begin{itemize}
63 \item Binary files
64 \item Intermediate stage between committing and pushing
65 \end{itemize}
66 \end{block}
67 \end{frame}
68
69 \section{Basics}
70 \subsection{Installation}
71 \begin{frame}[fragile]
72 \begin{block}{{\Large\Smiley\Smiley} Linux}
73 Depending on the distribution you may have to do:\\
74 \texttt{\# apt-get install git}\\
75 \texttt{\# pacman -S git}\\
76 \texttt{\# yum install git}\\
77 \texttt{\# emerge --ask dev-vcs/git}\\
78 Etc\ldots
79 \end{block}
80
81 \begin{block}{{\Large\Frowny\Smiley} Mac}
82 Install via XCode tools. Just run \lstinline{\$ git} and
83 when GIT is not installed it will prompt you with instructions.
84 \end{block}
85
86 \begin{block}{{\Large\Frowny\Frowny} Windows}
87 Downoad the binary from \url{http://git-scm.com/download/win} and install.
88 \end{block}
89
90 \end{frame}
91
92 \subsection{Getting started}
93 \begin{frame}[fragile]
94 \frametitle{Getting started}
95 \begin{block}{Check GIT version in (GIT) bash}
96 \begin{lstlisting}
97 frobnicator@frobmachine:~\$ git --version
98 git version 1.7.10.4
99 \end{lstlisting}
100 \end{block}
101
102 \begin{block}{Create a repository}
103 \begin{lstlisting}
104 frobnicator@frobmachine:~/projects\$ git init myfirstproject
105 Initialized empty Git repository in /home/frobnicator/projects/myfirstproject/.git/
106
107 frobnicator@frobmachine:~/projects\$ ls -1 myfirstproject/.git
108 branches/
109 config
110 description
111 HEAD
112 hooks/
113 info/
114 objects/
115 refs/
116 \end{lstlisting}
117 \end{block}
118 \end{frame}
119
120 \subsection{Four (five) stages}
121 \begin{frame}
122 \frametitle{Four (five) stages}
123 \begin{itemize}
124 \item (Stash)
125 \item Workspace
126 \item Index
127 \item Local repo
128 \item Upstream repo
129 \end{itemize}
130 \end{frame}
131
132 \begin{frame}
133 \frametitle{Workflow}
134 \begin{figure}[H]
135 \centering
136 \includegraphics[scale=0.4]{2.png}
137 \caption{Git workflow}
138 \end{figure}
139 \end{frame}
140
141 \begin{frame}[fragile]
142 \frametitle{Add and commit}
143 \begin{lstlisting}
144 frobnicator@frobmachine :~/projects/myfirstproject\$ echo "This is a frobfile" > frobbedfile
145
146 frobnicator@frobmachine:~/projects/myfirstproject\$ git status
147 On branch master
148
149 Initial commit
150
151 Untracked files:
152 (use "git add <file>..." to include in what will be committed)
153
154 frobbedfile
155
156 nothing added to commit but untracked files present (use "git add" to track)
157 \end{lstlisting}
158 \end{frame}
159
160 \begin{frame}[fragile]
161 \begin{lstlisting}
162 frobnicator@frobmachine:~/projects/myfirstproject\$ git add frobbedfile
163
164 frobnicator@frobmachine:~/projects/myfirstproject\$ git status
165 On branch master
166
167 Initial commit
168
169 Changes to be committed:
170 (use "git rm --cached <file>..." to unstage)
171
172 new file: frobbedfile
173
174 frobnicator@frobmachine:~/projects/myfirstproject\$ git commit
175 [master (root-commit) 2b7355e] Adds frobbedfile
176 1 file changed, 1 insertion(+)
177 create mode 100644 frobbedfile
178 \end{lstlisting}
179 \end{frame}
180
181 \begin{frame}
182 \frametitle{Log \& Checkout}
183 \begin{block}{\texttt{\$ git log}}
184
185 \end{block}
186 \end{frame}
187
188 \begin{frame}
189 \frametitle{Add and commit}
190 \end{frame}
191
192 \begin{frame}
193 \frametitle{Add and commit}
194 \end{frame}
195
196 \section{Branching}
197
198 \end{document}