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
d2221286
Commit
d2221286
authored
7 years ago
by
Mihai Lefter
Browse files
Options
Downloads
Patches
Plain Diff
Merging: commit graph.
parent
ee578da6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
merging/images/commit_graph/commit_graph_00.svg
+8295
-0
8295 additions, 0 deletions
merging/images/commit_graph/commit_graph_00.svg
merging/merging.tex
+37
-44
37 additions, 44 deletions
merging/merging.tex
with
8332 additions
and
44 deletions
merging/images/commit_graph/commit_graph_00.svg
0 → 100644
+
8295
−
0
View file @
d2221286
This diff is collapsed.
Click to expand it.
merging/merging.tex
+
37
−
44
View file @
d2221286
...
...
@@ -2,7 +2,7 @@
\input
{
../shared/shared.tex
}
\author
{
Martijn Vermaat
}
\author
{}
\title
{
\courseTitle
}
\providecommand
{
\mySubTitle
}{
Combining changes by merging
}
\providecommand
{
\myConference
}{
\courseTitle
}
...
...
@@ -39,70 +39,63 @@
\section
{
The Git commit graph
}
\subsection
{
A linear history
}
\begin{pframe}
\includegraphics
[width=10cm]
{
linear
}
\smallskip
\begin{center}
\includegraphics
[width=\textwidth]
{
images/commit
_
graph/commit
_
graph
_
00.pdf
}
\end{center}
\end{pframe}
\begin{
itemiz
e}
\item
Every commit has a parent.
\i
tem
{
\em
Committing
}
creates a new commit on top of the current one.
\end{
itemize
}
\begin{
pfram
e}
\begin{center}
\i
ncludegraphics
[width=\textwidth]
{
images/commit
_
graph/commit
_
graph
_
01.pdf
}
\end{
center
}
\end{pframe}
\subsection
{
The default
\lstinline
{
master
}
branch
}
\begin{pframe}
\includegraphics
[width=10cm]
{
master
}
\smallskip
\begin{center}
\includegraphics
[width=\textwidth]
{
images/commit
_
graph/commit
_
graph
_
02.pdf
}
\end{center}
\end{pframe}
\begin{itemize}
\item
A
{
\em
branch
}
is a pointer to a commit.
\item
By default there is one branch:
\lstinline
{
master
}
.
\item
\lstinline
{
HEAD
}
is a special pointer, it points to the current
branch.
\end{itemize}
\subsection
{
The
\lstinline
{
HEAD
}
pointer
}
\begin{pframe}
\begin{center}
\includegraphics
[width=\textwidth]
{
images/commit
_
graph/commit
_
graph
_
03.pdf
}
\end{center}
\end{pframe}
\subsection
{
Committing
moves the current branch pointer
}
\subsection
{
Committing
}
\begin{pframe}
\begin{itemize}
\item
Committing moves the current branch to the new commit.
\item
(Of course,
\lstinline
{
HEAD
}
moves with it.)
\end{itemize}
\bigskip
\begin{center}
\includegraphics
[width=\textwidth]
{
images/commit
_
graph/commit
_
graph
_
04.pdf
}
\end{center}
\end{pframe}
\includegraphics
[width=10cm]
{
commit
}
\begin{pframe}
\begin{center}
\includegraphics
[width=\textwidth]
{
images/commit
_
graph/commit
_
graph
_
05.pdf
}
\end{center}
\end{pframe}
\subsection
{
A non-linear history
}
\begin{pframe}
\includegraphics
[width=10cm]
{
nonlinear
}
\smallskip
\begin{itemize}
\item
The commit graph can become non-linear.
\item
Usually by committing from the same commit twice.
\end{itemize}
\begin{center}
\includegraphics
[width=\textwidth]
{
images/commit
_
graph/commit
_
graph
_
06.pdf
}
\end{center}
\end{pframe}
\subsection
{
Use branches to keep track of different code paths
}
\begin{pframe}
\begin{itemize}
\item
Branch names are easier to remember than commit hashes.
\item
Branch names make it clear what commits are about.
\end{itemize}
\bigskip
\includegraphics
[width=6cm]
{
branches
}
\begin{center}
\includegraphics
[width=\textwidth]
{
images/commit
_
graph/commit
_
graph
_
07.pdf
}
\end{center}
\end{pframe}
\subsection
{
Different code paths may later jo
in
}
\subsection
{
Merg
in
g
}
\begin{pframe}
\begin{itemize}
\item
Commits from different branches can be brought together.
\item
We call this
{
\em
merging
}
.
\end{itemize}
\bigskip
\includegraphics
[width=6cm]
{
merge
}
\begin{center}
\includegraphics
[width=\textwidth]
{
images/commit
_
graph/commit
_
graph
_
08.pdf
}
\end{center}
\end{pframe}
\section
{
Inspecting the commit graph
}
...
...
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