branching_handouts.tex 1.71 KB
Newer Older
Martijn Vermaat's avatar
Martijn Vermaat committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
\documentclass{article}
\usepackage{fullpage}

\frenchspacing
\setlength{\parindent}{0pt}
\pagestyle{empty}

\begin{document}
\begin{center}
{\bf Git Introduction Course}

Working with branches in Git practical.
\end{center}
\bigskip

\subsubsection*{Inspect the commit graph.}
We'll work from the repository you created in the previous practical.

\begin{itemize}
  \item \emph{Question:} What is you current branch and what is the hash of
    the commit it points to?
  \item \emph{Question:} What does the commit graph of you repository look
    like?
\end{itemize}
\emph{Hint:} Use \texttt{git log} with the appropriate arguments.

\bigskip

\subsubsection*{Implement a feature in a new branch.}
Let's do some real work (e.g., add some documentation to the project).

\bigskip

Start by creating a branch for your work (give it a descriptive name) and
switch to it.

\begin{itemize}
  \item \emph{Question:} What branches are there now and what are the commits
    they point to?
\end{itemize}

\bigskip

Implement your feature (e.g. write documentation) and commit your changes.

\begin{itemize}
  \item \emph{Question:} What does the commit graph of you repository look
    like now?
\end{itemize}

\bigskip

Martijn Vermaat's avatar
Martijn Vermaat committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
\subsubsection*{Merge your feature.}
Of course we want this nice feature in our \texttt{master} branch.

\bigskip

\begin{itemize}
  \item \emph{Question:} If you want to merge branch \texttt{B} into branch
    \texttt{A}, what should be your current branch?
\end{itemize}

\bigskip

Merge your feature branch into \texttt{master}.

\begin{itemize}
  \item \emph{Question:} What does the commit graph of you repository look
    like now?
\end{itemize}

\bigskip

Since you merged it, you can now delete the feature branch.

Martijn Vermaat's avatar
Martijn Vermaat committed
76
\end{document}