diff --git a/merging/merging_handouts.tex b/merging/merging_handouts.tex index 95a25ee948b38a411956bc6145f27892f671ae17..a369e850ca4b402d2e8d450763c74ecca5d8f72c 100644 --- a/merging/merging_handouts.tex +++ b/merging/merging_handouts.tex @@ -8,62 +8,35 @@ \begin{document} \makeHeader -\subsubsection*{Setting the stage} -In this practical, you'll work with the repository your neighbour created -during the previous practical. We'll refer to this repository as {\bf N}, and -to your own repository from the previous practical as {\bf Y}. -\bigskip - -Clone his or her repository to your local machine. Make sure to do this in a -separate directory. -\bigskip - -After you and your neighbour both cloned eachother's repositories: -\begin{enumerate} - \item Add a new commit to repository {\bf Y} on GitLab (so the one your - neighbour just cloned). - \item Wait for eachother before continuing. - \item Update your clone of {\bf N} with \lstinline{git fetch}. -\end{enumerate} -\bigskip - -\emph{Question:} What does the commit graph of your repository look like? Can -you draw it on paper? -\bigskip - -\emph{Hint:} Use \lstinline{git log} with the appropriate arguments. -\bigskip - \subsubsection*{Fast-forward merging} -Of course we want the nice commit your neighbour just made in our -\lstinline{master} branch. +Edit again a file from the GitLab interface and run a \lstinline{git fetch} command on your local machine. \bigskip -Merge the remote \lstinline{master} branch into \lstinline{master}. +Inspect the commit graph with \lstinline{git log}. +\bigskip -\begin{itemize} - \item \emph{Question:} What does the commit graph of you repository look - like now? -\end{itemize} +Perform a fast-forward merge of the origin master branch into your local master branch. \bigskip -\subsubsection*{A three-way merge} +\subsubsection*{A three-way merge with no conflicts} The previous section produced a fast-forward merge. -\bigskip \begin{itemize} - \item \emph{Question:} Can you think of a way to get a three-way merge? + \item \emph{Question:} Can you think of a way to get a three-way merge without conflicts? \end{itemize} + +Edit the same file on both your GitLab and local repositories (make sure that different lines are changed). \bigskip -Together with your neighbour, manipulate your repository in such a way that -the commit graph contains a merge commit (created by a three-way merge). +Run \lstinline{git fetch} on your local repository. \begin{itemize} \item \emph{Question:} What does the commit graph of you repository look - like now? + like now? Can you draw it on paper? \end{itemize} -\bigskip + +Perform a three-way merge and push to the GitLab remote repository. + \subsubsection*{Resolving a merge conflict} Now do the same thing again (a three-way merge), but in such a way the merge