Commit d2221286 authored by Mihai's avatar Mihai

Merging: commit graph.

parent ee578da6
This diff is collapsed.
......@@ -2,7 +2,7 @@
\input{../shared/shared.tex}
\author{Martijn Vermaat}
\author{}
\title{\courseTitle}
\providecommand{\mySubTitle}{Combining changes by merging}
\providecommand{\myConference}{\courseTitle}
......@@ -39,70 +39,63 @@
\section{The Git commit graph}
\subsection{A linear history}
\begin{pframe}
\includegraphics[width=10cm]{linear}
\smallskip
\begin{center}
\includegraphics[width=\textwidth]{images/commit_graph/commit_graph_00.pdf}
\end{center}
\end{pframe}
\begin{itemize}
\item Every commit has a parent.
\item {\em Committing} creates a new commit on top of the current one.
\end{itemize}
\begin{pframe}
\begin{center}
\includegraphics[width=\textwidth]{images/commit_graph/commit_graph_01.pdf}
\end{center}
\end{pframe}
\subsection{The default \lstinline{master} branch}
\begin{pframe}
\includegraphics[width=10cm]{master}
\smallskip
\begin{center}
\includegraphics[width=\textwidth]{images/commit_graph/commit_graph_02.pdf}
\end{center}
\end{pframe}
\begin{itemize}
\item A {\em branch} is a pointer to a commit.
\item By default there is one branch: \lstinline{master}.
\item \lstinline{HEAD} is a special pointer, it points to the current
branch.
\end{itemize}
\subsection{The \lstinline{HEAD} pointer}
\begin{pframe}
\begin{center}
\includegraphics[width=\textwidth]{images/commit_graph/commit_graph_03.pdf}
\end{center}
\end{pframe}
\subsection{Committing moves the current branch pointer}
\subsection{Committing}
\begin{pframe}
\begin{itemize}
\item Committing moves the current branch to the new commit.
\item (Of course, \lstinline{HEAD} moves with it.)
\end{itemize}
\bigskip
\begin{center}
\includegraphics[width=\textwidth]{images/commit_graph/commit_graph_04.pdf}
\end{center}
\end{pframe}
\includegraphics[width=10cm]{commit}
\begin{pframe}
\begin{center}
\includegraphics[width=\textwidth]{images/commit_graph/commit_graph_05.pdf}
\end{center}
\end{pframe}
\subsection{A non-linear history}
\begin{pframe}
\includegraphics[width=10cm]{nonlinear}
\smallskip
\begin{itemize}
\item The commit graph can become non-linear.
\item Usually by committing from the same commit twice.
\end{itemize}
\begin{center}
\includegraphics[width=\textwidth]{images/commit_graph/commit_graph_06.pdf}
\end{center}
\end{pframe}
\subsection{Use branches to keep track of different code paths}
\begin{pframe}
\begin{itemize}
\item Branch names are easier to remember than commit hashes.
\item Branch names make it clear what commits are about.
\end{itemize}
\bigskip
\includegraphics[width=6cm]{branches}
\begin{center}
\includegraphics[width=\textwidth]{images/commit_graph/commit_graph_07.pdf}
\end{center}
\end{pframe}
\subsection{Different code paths may later join}
\subsection{Merging}
\begin{pframe}
\begin{itemize}
\item Commits from different branches can be brought together.
\item We call this {\em merging}.
\end{itemize}
\bigskip
\includegraphics[width=6cm]{merge}
\begin{center}
\includegraphics[width=\textwidth]{images/commit_graph/commit_graph_08.pdf}
\end{center}
\end{pframe}
\section{Inspecting the commit graph}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment