Update push and add section
[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 \lstinline{# apt-get install git}\\
75 \lstinline{# pacman -S git}\\
76 \lstinline{# yum install git}\\
77 \lstinline{# 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 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 \begin{frame}[fragile]
141 \frametitle{Add and commit}
142 \begin{lstlisting}
143 frobnicator@frobmachine:~/projects/myfirstproject\$ echo "This is a frobfile" > frobbedfile
144 frobnicator@frobmachine:~/projects/myfirstproject\$ git status
145 On branch master
146
147 Initial commit
148
149 Untracked files:
150 (use "git add <file>..." to include in what will be committed)
151
152 frobbedfile
153
154 nothing added to commit but untracked files present (use "git add" to track)
155 \end{lstlisting}
156 \end{frame}
157
158 \begin{frame}[fragile]
159 \begin{lstlisting}
160 frobnicator@frobmachine:~/projects/myfirstproject\$ git add frobbedfile
161 frobnicator@frobmachine:~/projects/myfirstproject\$ git status
162 On branch master
163
164 Initial commit
165
166 Changes to be committed:
167 (use "git rm --cached <file>..." to unstage)
168
169 new file: frobbedfile
170 frobnicator@frobmachine:~/projects/myfirstproject\$ git commit
171 [master (root-commit) 2b7355e] Adds frobbedfile
172 1 file changed, 1 insertion(+)
173 create mode 100644 frobbedfile
174 \end{lstlisting}
175 \end{frame}
176
177 \begin{frame}
178 \frametitle{Push}
179 \end{frame}
180
181 \begin{frame}
182 \frametitle{Add and commit}
183 \end{frame}
184
185 \begin{frame}
186 \frametitle{Add and commit}
187 \end{frame}
188
189 \section{Branching}
190
191 \end{document}