Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Git course
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
courses
Git course
Commits
df4c66e8
Commit
df4c66e8
authored
7 years ago
by
Mihai Lefter
Browse files
Options
Downloads
Patches
Plain Diff
Merging handouts draft.
parent
cc833e67
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
merging/merging_handouts.tex
+13
-40
13 additions, 40 deletions
merging/merging_handouts.tex
with
13 additions
and
40 deletions
merging/merging_handouts.tex
+
13
−
40
View file @
df4c66e8
...
...
@@ -8,62 +8,35 @@
\begin{document}
\makeHeader
\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
}
.
\bigskip
Clone his or her repository to your local machine. Make sure to do this in a
separate directory.
\bigskip
After you and your neighbour both cloned eachother's repositories:
\begin{enumerate}
\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
}
.
\end{enumerate}
\bigskip
\emph
{
Question:
}
What does the commit graph of your repository look like? Can
you draw it on paper?
\bigskip
\emph
{
Hint:
}
Use
\lstinline
{
git log
}
with the appropriate arguments.
\bigskip
\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.
\bigskip
Merge the remote
\lstinline
{
master
}
branch into
\lstinline
{
master
}
.
Inspect the commit graph with
\lstinline
{
git log
}
.
\bigskip
\begin{itemize}
\item
\emph
{
Question:
}
What does the commit graph of you repository look
like now?
\end{itemize}
Perform a fast-forward merge of the origin master branch into your local master branch.
\bigskip
\subsubsection*
{
A three-way merge
}
\subsubsection*
{
A three-way merge
with no conflicts
}
The previous section produced a fast-forward merge.
\bigskip
\begin{itemize}
\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
?
\end{itemize}
Edit the same file on both your GitLab and local repositories (make sure that different lines are changed).
\bigskip
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.
\begin{itemize}
\item
\emph
{
Question:
}
What does the commit graph of you repository look
like now?
like now?
Can you draw it on paper?
\end{itemize}
\bigskip
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment