Commit df4c66e8 authored by Mihai Lefter's avatar Mihai Lefter
Browse files

Merging handouts draft.

parent cc833e67
......@@ -8,62 +8,35 @@
\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}.
Clone his or her repository to your local machine. Make sure to do this in a
separate directory.
After you and your neighbour both cloned eachother's repositories:
\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}.
\emph{Question:} What does the commit graph of your repository look like? Can
you draw it on paper?
\emph{Hint:} Use \lstinline{git log} with the appropriate arguments.
\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.
Merge the remote \lstinline{master} branch into \lstinline{master}.
Inspect the commit graph with \lstinline{git log}.
\item \emph{Question:} What does the commit graph of you repository look
like now?
Perform a fast-forward merge of the origin master branch into your local master branch.
\subsubsection*{A three-way merge}
\subsubsection*{A three-way merge with no conflicts}
The previous section produced a fast-forward merge.
\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?
Edit the same file on both your GitLab and local repositories (make sure that different lines are changed).
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.
\item \emph{Question:} What does the commit graph of you repository look
like now?
like now? Can you draw it on paper?
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
Supports Markdown
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