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