Skip to content
Snippets Groups Projects
Commit d2221286 authored by Mihai Lefter's avatar Mihai Lefter
Browse files

Merging: commit graph.

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