diff --git a/branching/branching_handouts.tex b/branching/branching_handouts.tex index 43aeb88223e7721e04122852949ef3dc0d71c24a..8dfaedf9f8f4be0535398b135dd9ec76348354e8 100644 --- a/branching/branching_handouts.tex +++ b/branching/branching_handouts.tex @@ -17,15 +17,20 @@ Working with branches in Git practical. 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 + \item \emph{Question:} What is your 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? + like? Can you draw it on paper? \end{itemize} \emph{Hint:} Use \texttt{git log} with the appropriate arguments. \bigskip +As an alternative to \texttt{git log}, you can also try a graphical viewer +such as \texttt{gitg} (installed on the course laptops) or \texttt{gitk}. + +\bigskip + \subsubsection*{Implement a feature in a new branch.} Let's do some real work (e.g., add some documentation to the project). @@ -73,4 +78,26 @@ Merge your feature branch into \texttt{master}. Since you merged it, you can now delete the feature branch. +\bigskip + +\subsubsection*{A three-way merge.} +Unless you were extremely zealous, the last section produced a fast-forward +merge. + +\bigskip + +\begin{itemize} + \item \emph{Question:} Can you think of a way to get a three-way merge? +\end{itemize} + +\bigskip + +Manipulate your repository in such a way that the commit graph contains a +merge commit (created by a three-way merge). + +\begin{itemize} + \item \emph{Question:} What does the commit graph of you repository look + like now? +\end{itemize} + \end{document}