Commit 553f081a authored by Mihai's avatar Mihai

Update commit graph lecture

parent 48f3229a
......@@ -437,6 +437,13 @@
\end{center}
\end{pframe}
\subsection{No }
error: Your local changes to the following files would be overwritten by merge:
data/capitals.txt
Please, commit your changes or stash them before you can merge.
Aborting
\subsection{Deleting branches}
\begin{pframe}
Old branches that have been merged can be deleted.
......
......@@ -34,39 +34,39 @@
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item a file
\item a merge conflict
\item a pointer to a commit
\item always a problem
\item to enable collaboration
\item a pointer to a commit
\item a merge conflict
\item where leaves could grow
\item none of the above
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\item What command is used in joining two or more development histories together:
\item What command could be used in joining two or more development histories (branches) together?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item join
\item combine
\item merge
\item pull
\item fork
\item intersect
\item git join
\item git combine
\item git merge
\item git pull
\item git fork
\item git intersect
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
\item What command displays the branches list:
\item Which of the following commands displays the branches list?
\vspace{-0.2cm}
\begin{multicols}{3}
\begin{enumerate}[label=(\alph*)]
\item show-branch
\item merge
\item display
\item branch
\item list
\item clone
\item git show-branch
\item git merge
\item git display
\item git branch
\item git list
\item git clone
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
......@@ -85,12 +85,12 @@
\end{multicols}
\vspace{-0.3cm}
\item In order to merge a branch into \colorbox{gray!20}{master} do we have to add and commit changes to that branch first?
\item In order to merge a branch into another one do we have to add and commit changes first?
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}[label=(\alph*)]
\item Yes
\item No
\item yes
\item no
\end{enumerate}
\end{multicols}
\vspace{-0.3cm}
......@@ -107,7 +107,7 @@
\end{multicols}
\vspace{-0.3cm}
\item Which of the following commands will delete the branch \colorbox{gray!20}{brand\_new}:
\item Which of the following commands will delete the branch \colorbox{gray!20}{brand\_new}?
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}[label=(\alph*)]
......@@ -135,7 +135,7 @@
\section{Inspecting the commit graph}
In the following you will work with the repository present in \colorbox{gray!20}{$\sim$/practice\_repo}.
In the following you will work with the repository present in \colorbox{gray!20}{$\sim$/commit-graph-practical}.
Please navigate to that directory and try to use the commands presented during the lecture (with their options accordingly) to perform the following tasks and answer the corresponding questions.
\begin{enumerate}
......@@ -150,13 +150,33 @@ Please navigate to that directory and try to use the commands presented during t
\end{enumerate}
\end{multicols}
\item Are you in a detached head state?
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}[label=(\alph*)]
\item yes
\item no
\end{enumerate}
\end{multicols}
\item What branch is active (checked out)?
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}[label=(\alph*)]
\item data
\item data-europe
\item documentation
\item master
\end{enumerate}
\end{multicols}
\item The commit graph looks like:
\vspace{-0.2cm}
\begin{center}
\includegraphics[width=\textwidth]{images/initial_practical_graph.pdf}
\end{center}
\item Merge branch \colorbox{gray!20}{documentation} into \colorbox{gray!20}{master}. What kind of merge was performed?
\item What merge type is performed if branch \colorbox{gray!20}{documentation} is merged into \colorbox{gray!20}{master}?
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}[label=(\alph*)]
......@@ -167,7 +187,9 @@ Please navigate to that directory and try to use the commands presented during t
\end{enumerate}
\end{multicols}
\item Merge branch \colorbox{gray!20}{data} into \colorbox{gray!20}{master}. What kind of merge was performed?
\item Merge branch \colorbox{gray!20}{documentation} into \colorbox{gray!20}{master}.
\item What merge type is performed if branch \colorbox{gray!20}{documentation} is merged into \colorbox{gray!20}{master}?
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}[label=(\alph*)]
......@@ -178,6 +200,8 @@ Please navigate to that directory and try to use the commands presented during t
\end{enumerate}
\end{multicols}
\item Merge branch \colorbox{gray!20}{documentation} into \colorbox{gray!20}{master}.
\end{enumerate}
......@@ -188,41 +212,96 @@ Next, you will make some file changes and manipulate the commit graph even furth
\subsection{Fast-forward merging}
Checkout branch \colorbox{gray!20}{data} and create a new branch called \colorbox{gray!20}{data-europe}.
\begin{enumerate}
\item Checkout branch \colorbox{gray!20}{data} and create a new branch called \colorbox{gray!20}{data-europe}.
\vspace{-0.1cm}
\item Edit the \colorbox{gray!20}{data/capitals.txt} file by adding at the end Rome as Italy's capital (``Italy:Rome'').
\vspace{-0.1cm}
\item Stage and commit the changes.
\vspace{-0.1cm}
\item Checkout branch \colorbox{gray!20}{data} and merge the \colorbox{gray!20}{data-europe} branch into it.
\item Why was the previous merge a fast-forward one?
\vspace{-0.2cm}
\begin{multicols}{2}
\begin{enumerate}[label=(\alph*)]
\item it was not
\item the branches did not diverge yet
\item different commits
\item none of the above
\end{enumerate}
\end{multicols}
Edit the \colorbox{gray!20}{capitals.txt} file by adding at the end some more european countries together with their capitals.
\end{enumerate}
\subsection{Three-way merging without conflicts}
\begin{enumerate}
\item Make sure branch \colorbox{gray!20}{data} is active (checkedout).
\vspace{-0.1cm}
\item Correct the USA capital to Washington D.C. in the \colorbox{gray!20}{data/capitals.txt} file.
\vspace{-0.1cm}
Checkout branch \colorbox{gray!20}{data} and perform a \textbf{fast-forward merge} of the \colorbox{gray!20}{data-europe} branch into \colorbox{gray!20}{data} branch.
\item Stage and commit the changes.
\vspace{-0.1cm}
\subsection{Three-way merging}
\item Checkout branch \colorbox{gray!20}{data-europe}.
\vspace{-0.1cm}
Branch \colorbox{gray!20}{data} should be checkedout. Correct the capital USA to Washington D.C. in the capitals.txt file and commit.
\item Add Paris as capital of France at the end of the \colorbox{gray!20}{data/capitals.txt} file.
\vspace{-0.1cm}
Checkout branch \colorbox{gray!20}{data-europe}. Add Paris as capital of France at the end of the file capitals.txt and commit.
\item Stage and commit the changes.
\vspace{-0.1cm}
Checkout branch \colorbox{gray!20}{data} and merge into it branch \colorbox{gray!20}{data-europe}.
\item Checkout branch \colorbox{gray!20}{data} and merge into it the \colorbox{gray!20}{data-europe} branch.
A three-way merge without conflicts should have been performed.
\end{enumerate}
\subsection{Resolving a merge conflict}
Checkout branch \colorbox{gray!20}{data}. Add Moscow as capital of Russia at the end of the file capitals.txt and commit.
\begin{enumerate}
\item Make sure branch \colorbox{gray!20}{data} is active (checkedout).
\vspace{-0.1cm}
Checkout branch \colorbox{gray!20}{data-europe} and add Madrid as the capital of Spain at the of the file capitals.txt and commit.
\item Add Moscow as capital of Russia at the end of the \colorbox{gray!20}{data/capitals.txt} file.
\vspace{-0.1cm}
Checkout branch \colorbox{gray!20}{data} and merge into it branch \colorbox{gray!20}{data-europe}.
\item Stage and commit the changes.
\vspace{-0.1cm}
A merge conflict should have occurred. Solve it and commit.
\item Checkout branch \colorbox{gray!20}{data-europe}.
\vspace{-0.1cm}
\item Add Madrid as Spain's capital at the of the \colorbox{gray!20}{data/capitals.txt} file.
\vspace{-0.1cm}
\item Stage and commit the changes.
\vspace{-0.1cm}
\item Checkout branch \colorbox{gray!20}{data} and merge into it the \colorbox{gray!20}{data-europe} branch.
\vspace{-0.1cm}
\item Solve the merge conflict that was created during the previous step.
\end{enumerate}
\subsection{Branch deletion}
Delete branch \colorbox{gray!20}{data-europe}.
\subsection{Branch deletion}
Merge branch \colorbox{gray!20}{data} into \colorbox{gray!20}{master}.
\begin{enumerate}
\item Delete the \colorbox{gray!20}{data-europe} branch.
\end{enumerate}
Delete branch \colorbox{gray!20}{data}
\vspace{1.5cm}
\section{Solutions}
\vspace{-0.1cm}
\begin{multicols}{6}
\begin{itemize}
\item 1.1 - d
......@@ -233,9 +312,14 @@ Delete branch \colorbox{gray!20}{data}
\item 1.6 - a
\item 1.7 - c
\item 1.8 - d
\item 1.9 - d
\item 2.1 -
\item 2.2 -
\item 1.9 - c
\item 2.1 - d
\item 2.2 - b
\item 2.3 - d
\item 2.4 - c
\item 2.5 - a
\item 2.7 - b
\item 3.1.5 - b
\end{itemize}
\end{multicols}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
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