merging_handouts.tex 1.5 KB
Newer Older
 Martijn Vermaat committed Nov 30, 2015 1 2 \documentclass{article}  Mihai committed Sep 06, 2017 3 \providecommand{\handoutsTitle}{\vspace{0.5cm}Combining changes by merging}  Martijn Vermaat committed Nov 30, 2015 4   Jeroen F.J. Laros committed Apr 24, 2016 5 6 \usepackage{handouts} \input{../shared/shared}  Martijn Vermaat committed Nov 30, 2015 7   Jeroen F.J. Laros committed Apr 24, 2016 8 9 \begin{document} \makeHeader  Martijn Vermaat committed Nov 30, 2015 10   Jeroen F.J. Laros committed Apr 24, 2016 11 \subsubsection*{Fast-forward merging}  Mihai committed Sep 05, 2017 12 Edit again a file from the GitLab interface and run a \lstinline{git fetch} command on your local machine.  Martijn Vermaat committed Nov 30, 2015 13 14 \bigskip  Mihai committed Sep 06, 2017 15 Inspect the \textbf{commit graph} with \lstinline{git log}. Make sure you utilize the options described during the lecture.  Mihai committed Sep 05, 2017 16 \bigskip  Martijn Vermaat committed Nov 30, 2015 17   Mihai committed Sep 06, 2017 18 Perform a \textbf{fast-forward merge} of the \textbf{origin master} branch into your \textbf{local master} branch.  Martijn Vermaat committed Nov 30, 2015 19 20 \bigskip  Mihai committed Sep 05, 2017 21 \subsubsection*{A three-way merge with no conflicts}  Mihai committed Sep 06, 2017 22 The previous section produced a fast-forward merge. In the following you will perform a \textbf{three-way merge}.  Martijn Vermaat committed Nov 30, 2015 23 24  \begin{itemize}  Mihai committed Sep 05, 2017 25  \item \emph{Question:} Can you think of a way to get a three-way merge without conflicts?  Martijn Vermaat committed Nov 30, 2015 26 \end{itemize}  Mihai committed Sep 05, 2017 27 28  Edit the same file on both your GitLab and local repositories (make sure that different lines are changed).  Martijn Vermaat committed Nov 30, 2015 29 30 \bigskip  Mihai committed Sep 05, 2017 31 Run \lstinline{git fetch} on your local repository.  Martijn Vermaat committed Nov 30, 2015 32 33 34  \begin{itemize} \item \emph{Question:} What does the commit graph of you repository look  Mihai committed Sep 05, 2017 35  like now? Can you draw it on paper?  Martijn Vermaat committed Nov 30, 2015 36 \end{itemize}  Mihai committed Sep 05, 2017 37   Mihai committed Sep 06, 2017 38 39 Perform a \textbf{three-way merge} and \textbf{push} to the GitLab remote repository. \bigskip  Martijn Vermaat committed Dec 01, 2015 40   Jeroen F.J. Laros committed Apr 24, 2016 41 \subsubsection*{Resolving a merge conflict}  Mihai committed Sep 06, 2017 42 Now do the same thing again (a three-way merge), but in such a way that the merge  Martijn Vermaat committed Dec 01, 2015 43 44 45 step will result in a merge conflict. Resolve the conflict in a way you feel is appropriate.  Martijn Vermaat committed Nov 30, 2015 46 \end{document}