X-Git-Url: https://git.martlubbers.net/?p=ai-gitflashtalk.git;a=blobdiff_plain;f=git.tex;h=9cbbe7ffb686fc1895a0eb8a0bc260790438b20d;hp=c336224f99b86600d75940dd940d857c8fc17b76;hb=ef6ac1d041b26604d943402a262b2f0b73c85334;hpb=03598f4e1e77f70ad661e8f6f287063f68466567 diff --git a/git.tex b/git.tex index c336224..9cbbe7f 100644 --- a/git.tex +++ b/git.tex @@ -15,11 +15,183 @@ \item Mart Lubbers \item 4th year bachelor AI \item \url{https://github.com/dopefishh/gitflashtalk} - \item Sha of this version: {\tiny\GITAbrHash} + \item SHA of the commit of this presentation: + {\tiny\GITAbrHash} \end{itemize} \end{frame} +\begin{frame} + \frametitle{Where did GIT come from?} + \begin{block}{History} + \begin{columns} \column{0.4\linewidth} + \begin{itemize} + \item Pronounce: \textipa{[g\'\i t]} + \item Linus Thorvalds + \item Linux kernel + \end{itemize} + + \column{0.5\linewidth} + \begin{figure}[H] + \centering + \includegraphics[width=0.5\linewidth]{1.png} + \caption{Linus Torvalds} + \end{figure} + \end{columns} + \end{block} + + \begin{block}{What is GIT?} + \begin{itemize} + \item Version control + \end{itemize} + \end{block} +\end{frame} + +\begin{frame} + \frametitle{Why GIT?} + \begin{block}{Pros} + \begin{itemize} + \item Fast + \item Scaleable + \item Simple + \item Support for non linear development + \item Intermediate stage between committing and pushing + \end{itemize} + \end{block} + + \begin{block}{Cons} + \begin{itemize} + \item Binary files + \item Intermediate stage between committing and pushing + \end{itemize} + \end{block} +\end{frame} + \section{Basics} +\subsection{Installation} +\begin{frame}[fragile] + \begin{block}{{\Large\Smiley\Smiley} Linux} + Depending on the distribution you may have to do:\\ + \texttt{\# apt-get install git}\\ + \texttt{\# pacman -S git}\\ + \texttt{\# yum install git}\\ + \texttt{\# emerge --ask dev-vcs/git}\\ + Etc\ldots + \end{block} + + \begin{block}{{\Large\Frowny\Smiley} Mac} + Install via XCode tools. Just run \lstinline{\$ git} and + when GIT is not installed it will prompt you with instructions. + \end{block} + + \begin{block}{{\Large\Frowny\Frowny} Windows} + Downoad the binary from \url{http://git-scm.com/download/win} and install. + \end{block} + +\end{frame} + +\subsection{Getting started} +\begin{frame}[fragile] + \frametitle{Getting started} + \begin{block}{Check GIT version in (GIT) bash} + \begin{lstlisting} +frobnicator@frobmachine:~\$ git --version +git version 1.7.10.4 + \end{lstlisting} + \end{block} + + \begin{block}{Create a repository} + \begin{lstlisting} +frobnicator@frobmachine:~/projects\$ git init myfirstproject +Initialized empty Git repository in /home/frobnicator/projects/myfirstproject/.git/ + +frobnicator@frobmachine:~/projects\$ ls -1 myfirstproject/.git +branches/ +config +description +HEAD +hooks/ +info/ +objects/ +refs/ + \end{lstlisting} + \end{block} +\end{frame} + +\subsection{Four (five) stages} +\begin{frame} + \frametitle{Four (five) stages} + \begin{itemize} + \item (Stash) + \item Workspace + \item Index + \item Local repo + \item Upstream repo + \end{itemize} +\end{frame} + +\begin{frame} + \frametitle{Workflow} + \begin{figure}[H] + \centering + \includegraphics[scale=0.4]{2.png} + \caption{Git workflow} + \end{figure} +\end{frame} + +\begin{frame}[fragile] + \frametitle{Add and commit} + \begin{lstlisting} +frobnicator@frobmachine :~/projects/myfirstproject\$ echo "This is a frobfile" > frobbedfile + +frobnicator@frobmachine:~/projects/myfirstproject\$ git status +On branch master + +Initial commit + +Untracked files: + (use "git add ..." to include in what will be committed) + + frobbedfile + +nothing added to commit but untracked files present (use "git add" to track) + \end{lstlisting} +\end{frame} + +\begin{frame}[fragile] + \begin{lstlisting} +frobnicator@frobmachine:~/projects/myfirstproject\$ git add frobbedfile + +frobnicator@frobmachine:~/projects/myfirstproject\$ git status +On branch master + +Initial commit + +Changes to be committed: + (use "git rm --cached ..." to unstage) + + new file: frobbedfile + +frobnicator@frobmachine:~/projects/myfirstproject\$ git commit +[master (root-commit) 2b7355e] Adds frobbedfile + 1 file changed, 1 insertion(+) + create mode 100644 frobbedfile + \end{lstlisting} +\end{frame} + +\begin{frame} + \frametitle{Log \& Checkout} + \begin{block}{\texttt{\$ git log}} + + \end{block} +\end{frame} + +\begin{frame} + \frametitle{Add and commit} +\end{frame} + +\begin{frame} + \frametitle{Add and commit} +\end{frame} \section{Branching}