diff --git a/chaos.png b/chaos.png new file mode 100644 index 0000000000000000000000000000000000000000..ddd7c3022dd80e5f339616e760b3ca19157fbbaf Binary files /dev/null and b/chaos.png differ diff --git a/git-tutorial.tex b/git-tutorial.tex index 6249b82dc28084138496d7ef459d6572d4fe5039..17d64493ef2f21603fc359d731ba1c6e194ffb11 100644 --- a/git-tutorial.tex +++ b/git-tutorial.tex @@ -21,6 +21,29 @@ \section{Introduction} \label{sec:intro} +Why use git, or any other version control software to keep track of +files? In short there are at least three big reasons why you should +version control your files, two of which are valid also if you work +all by yourself. See Figure~\ref{fig:chaos} for an illustration of the +first two reasons listed below: +\begin{description} +\item[Backups:] With version control you always have previous versions + of your files available, if you happen to do something stupid like + erasing a file. Or just regret a large edit later on. +\item[Organization:] Knowing which copy of a project directory is up + to date, and which ones are not, saves a lot of time and problems. +\item[Collaboration:] Everyone who has tried to collaborate with other + people by sending files, or parts of files, over email knows how + fragile that is. +\end{description} + +\begin{figure}[h!] + \centering + \pgfimage[width=.9\textwidth]{chaos.png} + \caption{Typical(?) result after version control by renaming.} + \label{fig:chaos} +\end{figure} + \section{Git Tools} \label{sec:tools} @@ -57,7 +80,18 @@ people. \subsection{Standalone Repository} \label{sec:standalone} The simplest use case is that of one single developer, one local -repository. +repository. Files in a project versioned with git go through the +following stages as you work on them, see Figure~\ref{fig:lifecycle}: +\begin{description} +\item[Untracked:] Git does not know anything about untracked files. +\item[Tracked, unmodified:] Git knows about these files, and there + have been no changes to them since lst commit. +\item[Tracked, modified:] Files tracked by git, there are changes made + to the file since last commit but git does not know whether these + changes should go into next commit. +\item[Staged:] The changes made to this file will be committed next + time you perform a commit. +\end{description} \begin{figure}[h!] \centering @@ -289,7 +323,8 @@ To stodola.control.lth.se:work/computers/git-tutorial \verb|http://git-scm.com/documentation| or\\ \verb|http://www.git-tower.com/files/cheatsheet/Git_Cheat_Sheet_grey.pdf| -\item The \emph{Pro Git} book is available online: \verb|http://git-scm.com/book| +\item The extensive \emph{Pro Git} handbook is available for free + online: \verb|http://git-scm.com/book| \end{itemize} \end{document}