Outline complete
[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{Installation}
70 \begin{frame}[fragile]
71 \begin{block}{{\Large\Smiley\Smiley} Linux}
72 Depending on the distribution you may have to do:\\
73 \texttt{\# apt-get install git}\\
74 \texttt{\# pacman -S git}\\
75 \texttt{\# yum install git}\\
76 \texttt{\# emerge --ask dev-vcs/git}\\
77 Etc\ldots
78 \end{block}
79
80 \begin{block}{{\Large\Frowny\Smiley} Mac}
81 Install via XCode tools. Just run \lstinline{\$ git} and
82 when GIT is not installed it will prompt you with instructions.
83 \end{block}
84
85 \begin{block}{{\Large\Frowny\Frowny} Windows}
86 Downoad the binary from \url{http://git-scm.com/download/win} and install.
87 \end{block}
88
89 \end{frame}
90
91 \section{Getting started \& Workflow}
92 \begin{frame}[fragile]
93 \frametitle{Getting started}
94 \begin{block}{Check GIT version in (GIT) bash}
95 \begin{lstlisting}
96 frobnicator@frobmachine:~\$ git --version
97 git version 1.7.10.4
98 \end{lstlisting}
99 \end{block}
100
101 \begin{block}{Create a repository}
102 \begin{lstlisting}
103 frobnicator@frobmachine:~/projects\$ git init myfirstproject
104 Initialized empty Git repository in /home/frobnicator/projects/myfirstproject/.git/
105
106 frobnicator@frobmachine:~/projects\$ ls -1 myfirstproject/.git
107 branches/
108 config
109 description
110 HEAD
111 hooks/
112 info/
113 objects/
114 refs/
115 \end{lstlisting}
116 \end{block}
117 \end{frame}
118
119 \subsection{Four (five) stages}
120 \begin{frame}
121 \frametitle{Four (five) stages}
122 \begin{itemize}
123 \item (Stash)
124 \item Workspace
125 \item Index
126 \item Local repo
127 \item Upstream repo
128 \end{itemize}
129 \end{frame}
130
131 \begin{frame}
132 \frametitle{Workflow}
133 \begin{figure}[H]
134 \centering
135 \includegraphics[scale=0.4]{2.png}
136 \caption{Git workflow}
137 \end{figure}
138 \end{frame}
139
140 \section{Everything is a commit}
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 \begin{block}{\texttt{\$ git checkout}}
187
188 \end{block}
189 \end{frame}
190
191 \section{Branching and unevitable merging}
192 \begin{frame}
193 \frametitle{Branching}
194 \end{frame}
195
196 \begin{frame}
197 \frametitle{Push \& Pull}
198 \end{frame}
199
200 \begin{frame}
201 \frametitle{Merge}
202 \end{frame}
203
204 \section{Tips \& Tricks}
205 \begin{frame}
206 \frametitle{\texttt{/home/frobnicator/.gitconfig}}
207 \end{frame}
208
209 \begin{frame}
210 \frametitle{Public key}
211
212 \end{frame}
213
214 \end{document}