merging_handouts.tex 1.5 KB
Newer Older
1 2
\documentclass{article}

Mihai's avatar
Mihai committed
3
\providecommand{\handoutsTitle}{\vspace{0.5cm}Combining changes by merging}
4

5 6
\usepackage{handouts}
\input{../shared/shared}
7

8 9
\begin{document}
\makeHeader
10

11
\subsubsection*{Fast-forward merging}
Mihai's avatar
Mihai committed
12
Edit again a file from the GitLab interface and run a \lstinline{git fetch} command on your local machine.
13 14
\bigskip

Mihai's avatar
Mihai committed
15
Inspect the \textbf{commit graph} with \lstinline{git log}. Make sure you utilize the options described during the lecture.
Mihai's avatar
Mihai committed
16
\bigskip
17

Mihai's avatar
Mihai committed
18
Perform a \textbf{fast-forward merge} of the \textbf{origin master} branch into your \textbf{local master} branch.
19 20
\bigskip

Mihai's avatar
Mihai committed
21
\subsubsection*{A three-way merge with no conflicts}
Mihai's avatar
Mihai committed
22
The previous section produced a fast-forward merge. In the following you will perform a \textbf{three-way merge}.
23 24

\begin{itemize}
Mihai's avatar
Mihai committed
25
  \item \emph{Question:} Can you think of a way to get a three-way merge without conflicts?
26
\end{itemize}
Mihai's avatar
Mihai committed
27 28

Edit the same file on both your GitLab and local repositories (make sure that different lines are changed).
29 30
\bigskip

Mihai's avatar
Mihai committed
31
Run \lstinline{git fetch} on your local repository.
32 33 34

\begin{itemize}
  \item \emph{Question:} What does the commit graph of you repository look
Mihai's avatar
Mihai committed
35
    like now? Can you draw it on paper?
36
\end{itemize}
Mihai's avatar
Mihai committed
37

Mihai's avatar
Mihai committed
38 39
Perform a \textbf{three-way merge} and \textbf{push} to the GitLab remote repository.
\bigskip
Martijn Vermaat's avatar
Martijn Vermaat committed
40

41
\subsubsection*{Resolving a merge conflict}
Mihai's avatar
Mihai committed
42
Now do the same thing again (a three-way merge), but in such a way that the merge
Martijn Vermaat's avatar
Martijn Vermaat committed
43 44 45
step will result in a merge conflict. Resolve the conflict in a way you feel
is appropriate.

46
\end{document}