Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
courses
Git course
Commits
d2221286
Commit
d2221286
authored
Sep 01, 2017
by
Mihai Lefter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merging: commit graph.
parent
ee578da6
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8332 additions
and
44 deletions
+8332
-44
merging/images/commit_graph/commit_graph_00.svg
merging/images/commit_graph/commit_graph_00.svg
+8295
-0
merging/merging.tex
merging/merging.tex
+37
-44
No files found.
merging/images/commit_graph/commit_graph_00.svg
0 → 100644
View file @
d2221286
This diff is collapsed.
Click to expand it.
merging/merging.tex
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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment