Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
courses
Git course
Commits
edf8ddf8
Commit
edf8ddf8
authored
Jun 22, 2014
by
Vermaat
Browse files
Merge branch 'updates_martijn' into 'master'
Updates martijn
parents
70584b68
e8fa90b3
Changes
4
Hide whitespace changes
Inline
Side-by-side
branching/branching.tex
View file @
edf8ddf8
...
...
@@ -2,7 +2,7 @@
\title
{
Working with branches in Git
}
\providecommand
{
\myConference
}{
Git course
}
\providecommand
{
\myDate
}{
Monday,
October 14
, 201
3
}
\providecommand
{
\myDate
}{
Monday,
June 23
, 201
4
}
\author
{
Martijn Vermaat
}
\providecommand
{
\myGroup
}{
Leiden Genome Technology Center
}
\providecommand
{
\myDepartment
}{
Department of Human Genetics
}
...
...
@@ -69,9 +69,10 @@
\begin{frame}
\frametitle
{
The current commit:
\bt
{
HEAD
}}
\begin{itemize}
\item
The current commit is called
\bt
{
HEAD
}
(shown in blue).
\item
\bt
{
HEAD
}
normally points to the current branch.
\item
Or to a commit if there is no current branch.
\item
The current commit is called
\bt
{
HEAD
}
(shown in blue here).
\item
\bt
{
HEAD
}
is actually a pointer to the current branch.
\item
(Or to the current commit if there is no current branch -- this is
called detached head state.)
\end{itemize}
\vspace
{
1cm
}
\includegraphics
[width=10cm]
{
images/head
}
...
...
@@ -82,7 +83,7 @@
\begin{itemize}
\item
Committing moves the current branch to the new commit.
\item
Of course,
\bt
{
HEAD
}
moves with it.
\item
If there is no current branch
, only
\bt
{
HEAD
}
moves.
\item
(In detached head state
, only
\bt
{
HEAD
}
moves.
)
\end{itemize}
\vspace
{
1cm
}
\includegraphics
[width=10cm]
{
images/commit
}
...
...
@@ -490,7 +491,7 @@ $ emacs README
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Resolving a merge conflict (
1
/2)
}
\frametitle
{
Resolving a merge conflict (
2
/2)
}
We resolve the conflict by hand.
\bigskip
\begin{lstlisting}
...
...
@@ -512,6 +513,30 @@ $ git commit
\end
{
lstlisting
}
\end
{
frame
}
\begin
{
frame
}
[
fragile
]
\frametitle
{
Aborting a merge
}
If you don't feel like resolving the merge conflict, you can go back with
\bt
{
git merge
--
abort
}
.
\bigskip
\begin
{
lstlisting
}
$
git merge simpsons
Auto-merging README
CONFLICT (content): Merge conflict in README
Automatic merge failed; fix conflicts and then
commit the result.
\end{lstlisting}
\bigskip
\begin{lstlisting}
$
git merge
--
abort
\end
{
lstlisting
}
\bigskip
\begin
{
lstlisting
}
$
git status
# On branch master
nothing to commit (working directory clean)
\end{lstlisting}
\end{frame}
\begin{frame}
[fragile]
\frametitle
{
Resolving conflicts with
\bt
{
git mergetool
}}
We can also use graphical merge tools such as
{
\em
Meld
}
.
...
...
@@ -549,6 +574,7 @@ Hit return to start merge resolution tool (meld):
Zuotian Tatum
Wibowo Arindrarto
\end
{
center
}
\vfill
\permfoot
{
http:
//
git
-
scm.com
/
book
}
\\
...
...
branching/branching_handouts.tex
View file @
edf8ddf8
...
...
@@ -17,15 +17,20 @@ Working with branches in Git practical.
We'll work from the repository you created in the previous practical.
\begin{itemize}
\item
\emph
{
Question:
}
What is you current branch and what is the hash of
\item
\emph
{
Question:
}
What is you
r
current branch and what is the hash of
the commit it points to?
\item
\emph
{
Question:
}
What does the commit graph of you repository look
like?
like?
Can you draw it on paper?
\end{itemize}
\emph
{
Hint:
}
Use
\texttt
{
git log
}
with the appropriate arguments.
\bigskip
As an alternative to
\texttt
{
git log
}
, you can also try a graphical viewer
such as
\texttt
{
gitg
}
(installed on the course laptops) or
\texttt
{
gitk
}
.
\bigskip
\subsubsection*
{
Implement a feature in a new branch.
}
Let's do some real work (e.g., add some documentation to the project).
...
...
@@ -73,4 +78,26 @@ Merge your feature branch into \texttt{master}.
Since you merged it, you can now delete the feature branch.
\bigskip
\subsubsection*
{
A three-way merge.
}
Unless you were extremely zealous, the last section produced a fast-forward
merge.
\bigskip
\begin{itemize}
\item
\emph
{
Question:
}
Can you think of a way to get a three-way merge?
\end{itemize}
\bigskip
Manipulate your repository in such a way that the commit graph contains a
merge commit (created by a three-way merge).
\begin{itemize}
\item
\emph
{
Question:
}
What does the commit graph of you repository look
like now?
\end{itemize}
\end{document}
remotes/remotes.tex
View file @
edf8ddf8
...
...
@@ -2,7 +2,7 @@
\title
{
Git and remote repositories
}
\providecommand
{
\myConference
}{
Git course
}
\providecommand
{
\myDate
}{
Monday,
October 14
, 201
3
}
\providecommand
{
\myDate
}{
Monday,
June 23
, 201
4
}
\author
{
Martijn Vermaat
}
\providecommand
{
\myGroup
}{
Leiden Genome Technology Center
}
\providecommand
{
\myDepartment
}{
Department of Human Genetics
}
...
...
@@ -310,6 +310,7 @@ $ git pull ==> $ git fetch origin
Zuotian Tatum
Wibowo Arindrarto
\end{center}
\vfill
\permfoot
{
http://git-scm.com/book
}
\\
...
...
remotes/remotes_handouts.tex
View file @
edf8ddf8
...
...
@@ -13,12 +13,30 @@ Git and remote repositories practical.
\end{center}
\bigskip
\subsubsection*
{
Some notes about using GitLab.
}
Please take the following into account with respect to our GitLab server:
\begin{itemize}
\item
You can login to GitLab using your LUMC account.
\item
If you don't have an LUMC account, ask us to create a GitLab account
for you and select
{
\em
Standard
}
instead of
{
\em
LDAP
}
on the login
page.
\item
Due to the LUMC firewall, accessing repositories using SSH is only
possible from the LUMC network (and not from the LUMC gast network). As an
alternative, you can always use HTTPS but the downside is that you have to
keep repeating your password.
\item
Our GitLab server is very similar (in fact, it is a clone) to the
popular online GitHub (
\texttt
{
https://github.com
}
) and Bitbucket
(
\texttt
{
https://bitbucket.org
}
) services.
\end{itemize}
\bigskip
\subsubsection*
{
Add your repository to GitLab.
}
Now you have a nice repository, of course you want to share it on GitLab.
\bigskip
Go to GitLab and create a new project.
Go to GitLab
(
\texttt
{
https://git.lumc.nl
}
)
and create a new project.
\begin{itemize}
\item
\emph
{
Question:
}
What is the repository URL for your new project?
...
...
@@ -26,7 +44,7 @@ Go to GitLab and create a new project.
\bigskip
Add a remote
for
your
GitLab
repository.
Add
the GitLab repository as
a remote
to
your
local
repository.
\bigskip
...
...
@@ -37,6 +55,7 @@ Push your branch(es) to GitLab.
interface?
\end{itemize}
\bigskip
\subsubsection*
{
Clone an existing repository from GitLab.
}
There already are some nice repositories on GitLab! Pick one (e.g., from the
...
...
@@ -52,8 +71,9 @@ Create a local clone of the repository you picked.
branches exist?
\end{itemize}
\bigskip
\subsubsection*
{
For experts: c
reate a merge request.
}
\subsubsection*
{
C
reate a merge request.
}
If you are interested, here are some additional GitLab features you can
use. Fork an existing project, implement a feature, and submit a merge
request.
...
...
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