Commit 060914bf authored by Jeroen F.J. Laros's avatar Jeroen F.J. Laros

Standardised handouts.

parent 669c8dfb
\documentclass{article}
\usepackage{fullpage}
\frenchspacing
\setlength{\parindent}{0pt}
\pagestyle{empty}
\providecommand{\handoutsTitle}{Git Basics}
\begin{document}
\begin{center}
{\bf Git Introduction Course}
\usepackage{handouts}
\input{../shared/shared}
Git Basics practical.
\end{center}
\bigskip
\begin{document}
\makeHeader
\subsubsection*{Create a repository.}
First, create an empty directory and use ``\texttt{git init}'' to make a new
\subsubsection*{Create a repository}
First, create an empty directory and use ``\lstinline{git init}'' to make a new
repository.
\begin{itemize}
\item \emph{Hint:} Use a unique name for the directory, different from your
......@@ -27,15 +22,15 @@ repository.
Check the status of your files.
\bigskip
\subsubsection*{Your first commit.}
\subsubsection*{Your first commit}
Create a new file named ``README'' (with an editor, or by using the
``\texttt{touch}'' command).
``\lstinline{touch}'' command).
\begin{itemize}
\item \emph{Question:} What is the status of this new file?
\end{itemize}
\bigskip
Stage this file for the next commit using ``\texttt{git add}''.
Stage this file for the next commit using ``\lstinline{git add}''.
\begin{itemize}
\item \emph{Question:} What is the status of this file now?
\end{itemize}
......@@ -47,20 +42,20 @@ Commit your changes.
\end{itemize}
\bigskip
\subsubsection*{Manipulation in the staging area.}
\subsubsection*{Manipulation in the staging area}
Edit your file and stage it.
\bigskip
Now remove the file from the staging area.
\bigskip
\subsubsection*{Working with versions.}
\subsubsection*{Working with versions}
Commit your changed file.
\bigskip
Now you change your mind, and want to revert this commit.
\begin{itemize}
\item \emph{Hint:} Use ``\texttt{git log}'' to see a list of all your
\item \emph{Hint:} Use ``\lstinline{git log}'' to see a list of all your
versions.
\end{itemize}
\bigskip
......@@ -72,4 +67,5 @@ Edit your file again and check the differences with your last commit.
\bigskip
Make a file that you do not want to track.
\end{document}
../presentation/handouts.sty
\ No newline at end of file
\documentclass{article}
\usepackage{fullpage}
\frenchspacing
\setlength{\parindent}{0pt}
\pagestyle{empty}
\providecommand{\handoutsTitle}{Working with branches in Git}
\begin{document}
\begin{center}
{\bf Git Introduction Course}
\usepackage{handouts}
\input{../shared/shared}
Working with branches in Git practical.
\end{center}
\bigskip
\begin{document}
\makeHeader
\subsubsection*{Inspect the commit graph.}
\subsubsection*{Inspect the commit graph}
We'll work from the repository you created in the previous practical.
\begin{itemize}
......@@ -22,18 +17,15 @@ We'll work from the repository you created in the previous practical.
\item \emph{Question:} What does the commit graph of you repository look
like? Can you draw it on paper?
\end{itemize}
\emph{Hint:} Use \texttt{git log} with the appropriate arguments.
\emph{Hint:} Use \lstinline{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}.
As an alternative to \lstinline{git log}, you can also try a graphical viewer
such as \lstinline{gitg} (installed on the course laptops) or \lstinline{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).
\bigskip
Start by creating a branch for your work (give it a descriptive name) and
......@@ -43,7 +35,6 @@ switch to it.
\item \emph{Question:} What branches are there now and what are the commits
they point to?
\end{itemize}
\bigskip
Implement your feature (e.g. write documentation) and commit your changes.
......@@ -52,44 +43,37 @@ Implement your feature (e.g. write documentation) and commit your changes.
\item \emph{Question:} What does the commit graph of you repository look
like now?
\end{itemize}
\bigskip
\subsubsection*{Merge your feature.}
Of course we want this nice feature in our \texttt{master} branch.
\subsubsection*{Merge your feature}
Of course we want this nice feature in our \lstinline{master} branch.
\bigskip
\begin{itemize}
\item \emph{Question:} If you want to merge branch \texttt{B} into branch
\texttt{A}, what should be your current branch?
\item \emph{Question:} If you want to merge branch \lstinline{B} into branch
\lstinline{A}, what should be your current branch?
\end{itemize}
\bigskip
Merge your feature branch into \texttt{master}.
Merge your feature branch into \lstinline{master}.
\begin{itemize}
\item \emph{Question:} What does the commit graph of you repository look
like now?
\end{itemize}
\bigskip
Since you merged it, you can now delete the feature branch.
\bigskip
\subsubsection*{A three-way merge.}
\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
......
../presentation/handouts.sty
\ No newline at end of file
../presentation/handouts.sty
\ No newline at end of file
\documentclass{article}
\usepackage{fullpage}
\usepackage{listings}
\frenchspacing
\setlength{\parindent}{0pt}
\pagestyle{empty}
\providecommand{\handoutsTitle}{Git Introduction}
\begin{document}
\begin{center}
{\bf Git Introduction Course}
\usepackage{handouts}
\input{../shared/shared}
Git Introduction practical.
\end{center}
\bigskip
\begin{document}
\makeHeader
\subsubsection*{Local configuration}
First, let Git know what your name and e-mail address is:
\begin{lstlisting}
$ git config --global user.name "<Your Name>"
$ git config --global user.email "<name@lumc.nl>"
$ git config --global user.name "Your Name"
$ git config --global user.email "your@email.address"
$ cat ~/.gitconfig
\end{lstlisting}
\bigskip
For the other practicals, it is convenient to have a \texttt{projects} folder
for your repositories:
For the other practicals, it is convenient to have a \lstinline{projects}
folder for your repositories:
\begin{lstlisting}
mkdir ~/projects
cd ~/projects
......@@ -47,7 +41,7 @@ If not, make one:
You can leave all fields blank.
\bigskip
Open \texttt{https://git.lumc.nl} in your browser.
Open \url{https://git.lumc.nl} in your browser.
\medskip
In the authentication form, use your username and password.
......@@ -67,6 +61,6 @@ To be able to upload new versions, you need to add your ssh key. Click the
Give your key a title (e.g., ``Course laptop'').
\medskip
Copy your ssh key to the key field (see the \texttt{cat} command above).
Copy your ssh key to the key field (see the \lstinline{cat} command above).
\end{document}
../presentation/handouts.sty
\ No newline at end of file
\documentclass{article}
\usepackage{fullpage}
\frenchspacing
\setlength{\parindent}{0pt}
\pagestyle{empty}
\providecommand{\handoutsTitle}{Combining changes by merging}
\begin{document}
\begin{center}
{\bf Git Introduction Course}
\usepackage{handouts}
\input{../shared/shared}
Combining changes by merging practical.
\end{center}
\bigskip
\begin{document}
\makeHeader
\subsubsection*{Setting the stage.}
\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:
......@@ -30,49 +23,41 @@ After you and your neighbour both cloned eachother's repositories:
\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 \texttt{git fetch}.
\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?
\emph{Question:} What does the commit graph of your repository look like? Can
you draw it on paper?
\bigskip
\emph{Hint:} Use \texttt{git log} with the appropriate arguments.
\emph{Hint:} Use \lstinline{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}.
As an alternative to \lstinline{git log}, you can also try a graphical viewer
such as \lstinline{gitg} (installed on the course laptops) or \lstinline{gitk}.
\bigskip
\subsubsection*{Fast-forward merging.}
\subsubsection*{Fast-forward merging}
Of course we want the nice commit your neighbour just made in our
\texttt{master} branch.
\lstinline{master} branch.
\bigskip
Merge the remote \texttt{master} branch into \texttt{master}.
Merge the remote \lstinline{master} branch into \lstinline{master}.
\begin{itemize}
\item \emph{Question:} What does the commit graph of you repository look
like now?
\end{itemize}
\bigskip
\subsubsection*{A three-way merge.}
\subsubsection*{A three-way merge}
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?
\end{itemize}
\bigskip
Together with your neighbour, manipulate your repository in such a way that
......@@ -82,13 +67,11 @@ the commit graph contains a merge commit (created by a three-way merge).
\item \emph{Question:} What does the commit graph of you repository look
like now?
\end{itemize}
\bigskip
\subsubsection*{Resolving a merge conflict.}
\subsubsection*{Resolving a merge conflict}
Now do the same thing again (a three-way merge), but in such a way the merge
step will result in a merge conflict. Resolve the conflict in a way you feel
is appropriate.
\end{document}
Subproject commit 5dc55db7bd0e1be6f32c156c0dc3908a8e29e394
Subproject commit d197f21f0884f2f28f0e450d7ff47efd21741ea7
../presentation/handouts.sty
\ No newline at end of file
\documentclass{article}
\usepackage{fullpage}
\frenchspacing
\setlength{\parindent}{0pt}
\pagestyle{empty}
\providecommand{\handoutsTitle}{Git and remote repositories}
\begin{document}
\begin{center}
{\bf Git Introduction Course}
\usepackage{handouts}
\input{../shared/shared}
Git and remote repositories practical.
\end{center}
\bigskip
\begin{document}
\makeHeader
\subsubsection*{Some notes about using GitLab.}
\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.
......@@ -21,33 +16,29 @@ Please take the following into account with respect to our GitLab server:
for you and select {\em Standard} instead of {\em LDAP} on the login
page.
\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.
popular online GitHub (\url{https://github.com}) and Bitbucket
(\url{https://bitbucket.org}) services.
\end{itemize}
\bigskip
\subsubsection*{Add your repository to GitLab.}
\subsubsection*{Add your repository to GitLab}
\begin{quote}
(If you don't have a repository on your local machine from the previous
practical, create one now with at least one commit.)
\end{quote}
Now you have a nice repository, of course you want to share it on GitLab.
\bigskip
Go to GitLab (\texttt{https://git.lumc.nl}) and create a new project (use the
Go to GitLab (\url{https://git.lumc.nl}) and create a new project (use the
same name you used to store your repository locally).
\begin{itemize}
\item \emph{Question:} What is the repository URL for your new project?
\end{itemize}
\bigskip
Add the GitLab repository as a remote to your local repository.
\bigskip
Push your commits to GitLab.
......@@ -56,28 +47,23 @@ Push your commits to GitLab.
\item \emph{Question:} Can you see your repository content in the GitLab web
interface?
\end{itemize}
\bigskip
\emph{Hint:} Use \texttt{git push} once with the \texttt{-u} flag so you can
use the \texttt{git push/pull} shortcuts.
\emph{Hint:} Use \lstinline{git push} once with the \lstinline{-u} flag so you
can use the \lstinline{git push} / \lstinline{git pull} shortcuts.
\bigskip
\subsubsection*{More synchronisation.}
\subsubsection*{More synchronisation}
Look for a way to edit a file directly from the GitLab web interface (in your
browser) and do this at least once.
\bigskip
Update your local copy of the file with the change you just made (by fetching
and merging).
\bigskip
Now make another commit locally and push it to the GitLab server. Verify that
all these changes are now present both on your local machine and on the GitLab
server.
\end{document}
\providecommand{\courseTitle}{Code and data management with Git}
\providecommand{\myDate}{25-04-16}
\providecommand{\acknowledgements}{
Martijn Vermaat\\
Wibowo Arindrarto\\
......
../presentation/handouts.sty
\ No newline at end of file
\documentclass{article}
\usepackage{fullpage}
\usepackage{listings}
\frenchspacing
\setlength{\parindent}{0pt}
\pagestyle{empty}
\providecommand{\handoutsTitle}{Project skeleton}
\begin{document}
\begin{center}
{\bf Git Introduction Course}
\usepackage{handouts}
\input{../shared/shared}
Project skeleton practical.
\end{center}
\bigskip
\begin{document}
\makeHeader
\subsubsection*{Project skeleton.}
\subsubsection*{Project skeleton}
Search for the ``Project skeleton''.
\begin{itemize}
\item \emph{Hint:} Click the ``Public area'' icon and use the search option.
......@@ -25,11 +19,11 @@ Follow the README to make your own analysis project.
\bigskip
Suppose you are going to do an RNASeq analysis. Retrieve the file
``\texttt{data.tgz}'' from the
wiki\footnote{https://humgenprojects.lumc.nl/trac/humgenprojects/wiki/git} and
populate your analysis project.
``\lstinline{data.tgz}'' from the
wiki\footnote{\url{https://humgenprojects.lumc.nl/trac/humgenprojects/wiki/git}}
and populate your analysis project.
\subsubsection*{Git annex.}
\subsubsection*{Git annex}
Check whether Git annex is installed, and install it if this is not the case.
\begin{lstlisting}
$ git annex
......@@ -65,8 +59,8 @@ Now, we clone the project and let this repository know where the clone is.
\end{lstlisting}
\bigskip
With the ``\texttt{file}'' command you can now see that
``\texttt{bigdata.dat}'' is not present in this repository.
With the ``\lstinline{file}'' command you can now see that
``\lstinline{bigdata.dat}'' is not present in this repository.
\begin{lstlisting}
$ git pull
$ git annex get bigfile.dat
......@@ -87,4 +81,5 @@ You can now remove the big data file from the original repository.
\end{lstlisting}
But you can not remove it from the clone.
\end{document}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment