Skip to content
Snippets Groups Projects
Commit edf8ddf8 authored by Vermaat's avatar Vermaat
Browse files

Merge branch 'updates_martijn' into 'master'

Updates martijn
parents 70584b68 e8fa90b3
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
\title{Working with branches in Git} \title{Working with branches in Git}
\providecommand{\myConference}{Git course} \providecommand{\myConference}{Git course}
\providecommand{\myDate}{Monday, October 14, 2013} \providecommand{\myDate}{Monday, June 23, 2014}
\author{Martijn Vermaat} \author{Martijn Vermaat}
\providecommand{\myGroup}{Leiden Genome Technology Center} \providecommand{\myGroup}{Leiden Genome Technology Center}
\providecommand{\myDepartment}{Department of Human Genetics} \providecommand{\myDepartment}{Department of Human Genetics}
...@@ -69,9 +69,10 @@ ...@@ -69,9 +69,10 @@
\begin{frame} \begin{frame}
\frametitle{The current commit: \bt{HEAD}} \frametitle{The current commit: \bt{HEAD}}
\begin{itemize} \begin{itemize}
\item The current commit is called \bt{HEAD} (shown in blue). \item The current commit is called \bt{HEAD} (shown in blue here).
\item \bt{HEAD} normally points to the current branch. \item \bt{HEAD} is actually a pointer to the current branch.
\item Or to a commit if there is no current branch. \item (Or to the current commit if there is no current branch -- this is
called detached head state.)
\end{itemize} \end{itemize}
\vspace{1cm} \vspace{1cm}
\includegraphics[width=10cm]{images/head} \includegraphics[width=10cm]{images/head}
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
\begin{itemize} \begin{itemize}
\item Committing moves the current branch to the new commit. \item Committing moves the current branch to the new commit.
\item Of course, \bt{HEAD} moves with it. \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} \end{itemize}
\vspace{1cm} \vspace{1cm}
\includegraphics[width=10cm]{images/commit} \includegraphics[width=10cm]{images/commit}
...@@ -490,7 +491,7 @@ $ emacs README ...@@ -490,7 +491,7 @@ $ emacs README
\end{frame} \end{frame}
\begin{frame}[fragile] \begin{frame}[fragile]
\frametitle{Resolving a merge conflict (1/2)} \frametitle{Resolving a merge conflict (2/2)}
We resolve the conflict by hand. We resolve the conflict by hand.
\bigskip \bigskip
\begin{lstlisting} \begin{lstlisting}
...@@ -512,6 +513,30 @@ $ git commit ...@@ -512,6 +513,30 @@ $ git commit
\end{lstlisting} \end{lstlisting}
\end{frame} \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] \begin{frame}[fragile]
\frametitle{Resolving conflicts with \bt{git mergetool}} \frametitle{Resolving conflicts with \bt{git mergetool}}
We can also use graphical merge tools such as {\em Meld}. We can also use graphical merge tools such as {\em Meld}.
...@@ -549,6 +574,7 @@ Hit return to start merge resolution tool (meld): ...@@ -549,6 +574,7 @@ Hit return to start merge resolution tool (meld):
Zuotian Tatum Zuotian Tatum
Wibowo Arindrarto
\end{center} \end{center}
\vfill \vfill
\permfoot{http://git-scm.com/book}\\ \permfoot{http://git-scm.com/book}\\
......
...@@ -17,15 +17,20 @@ Working with branches in Git practical. ...@@ -17,15 +17,20 @@ Working with branches in Git practical.
We'll work from the repository you created in the previous practical. We'll work from the repository you created in the previous practical.
\begin{itemize} \begin{itemize}
\item \emph{Question:} What is you current branch and what is the hash of \item \emph{Question:} What is your current branch and what is the hash of
the commit it points to? the commit it points to?
\item \emph{Question:} What does the commit graph of you repository look \item \emph{Question:} What does the commit graph of you repository look
like? like? Can you draw it on paper?
\end{itemize} \end{itemize}
\emph{Hint:} Use \texttt{git log} with the appropriate arguments. \emph{Hint:} Use \texttt{git log} with the appropriate arguments.
\bigskip \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.} \subsubsection*{Implement a feature in a new branch.}
Let's do some real work (e.g., add some documentation to the project). 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}. ...@@ -73,4 +78,26 @@ Merge your feature branch into \texttt{master}.
Since you merged it, you can now delete the feature branch. 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} \end{document}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
\title{Git and remote repositories} \title{Git and remote repositories}
\providecommand{\myConference}{Git course} \providecommand{\myConference}{Git course}
\providecommand{\myDate}{Monday, October 14, 2013} \providecommand{\myDate}{Monday, June 23, 2014}
\author{Martijn Vermaat} \author{Martijn Vermaat}
\providecommand{\myGroup}{Leiden Genome Technology Center} \providecommand{\myGroup}{Leiden Genome Technology Center}
\providecommand{\myDepartment}{Department of Human Genetics} \providecommand{\myDepartment}{Department of Human Genetics}
...@@ -310,6 +310,7 @@ $ git pull ==> $ git fetch origin ...@@ -310,6 +310,7 @@ $ git pull ==> $ git fetch origin
Zuotian Tatum Zuotian Tatum
Wibowo Arindrarto
\end{center} \end{center}
\vfill \vfill
\permfoot{http://git-scm.com/book}\\ \permfoot{http://git-scm.com/book}\\
......
...@@ -13,12 +13,30 @@ Git and remote repositories practical. ...@@ -13,12 +13,30 @@ Git and remote repositories practical.
\end{center} \end{center}
\bigskip \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.} \subsubsection*{Add your repository to GitLab.}
Now you have a nice repository, of course you want to share it on GitLab. Now you have a nice repository, of course you want to share it on GitLab.
\bigskip \bigskip
Go to GitLab and create a new project. Go to GitLab (\texttt{https://git.lumc.nl}) and create a new project.
\begin{itemize} \begin{itemize}
\item \emph{Question:} What is the repository URL for your new project? \item \emph{Question:} What is the repository URL for your new project?
...@@ -26,7 +44,7 @@ Go to GitLab and create a new project. ...@@ -26,7 +44,7 @@ Go to GitLab and create a new project.
\bigskip \bigskip
Add a remote for your GitLab repository. Add the GitLab repository as a remote to your local repository.
\bigskip \bigskip
...@@ -37,6 +55,7 @@ Push your branch(es) to GitLab. ...@@ -37,6 +55,7 @@ Push your branch(es) to GitLab.
interface? interface?
\end{itemize} \end{itemize}
\bigskip
\subsubsection*{Clone an existing repository from GitLab.} \subsubsection*{Clone an existing repository from GitLab.}
There already are some nice repositories on GitLab! Pick one (e.g., from the 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. ...@@ -52,8 +71,9 @@ Create a local clone of the repository you picked.
branches exist? branches exist?
\end{itemize} \end{itemize}
\bigskip
\subsubsection*{For experts: create a merge request.} \subsubsection*{Create a merge request.}
If you are interested, here are some additional GitLab features you can If you are interested, here are some additional GitLab features you can
use. Fork an existing project, implement a feature, and submit a merge use. Fork an existing project, implement a feature, and submit a merge
request. request.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment