Commit 70584b68 authored by Martijn Vermaat's avatar Martijn Vermaat

Merge branch 'jfjlaros_2014' into 'master'

Jfjlaros 2014
parents ef4d7217 d42938da
../pics/src/18333fig0101-tn.png
\ No newline at end of file
../pics/src/18333fig0102-tn.png
\ No newline at end of file
../pics/src/18333fig0103-tn.png
\ No newline at end of file
......@@ -31,9 +31,8 @@
% First page of the presentation.
\section{Introduction}
\begin{frame}
\frametitle{Version control.}
\subsection{Version control}
\begin{pframe}
\emph{The management of changes to documents, computer programs, large web
sites, and other collections of information.} --- Wikipedia.
\bigskip
......@@ -48,18 +47,16 @@
\end{itemize}
\item Enables collaboration.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Why should I use it?}
\end{pframe}
\subsection{Why should I use it?}
\begin{pframe}
For a single user:
\begin{itemize}
\item Revert files to a previous state.
\item Revert the entire project back to a previous state.
\item Review changes made over time.
\item Backup.
\item \ldots
\end{itemize}
\bigskip
\pause
......@@ -70,13 +67,11 @@
\item Allow multiple people working on the same project at the same time.
\item Conflict resolution.
\item See who made which changes at which time.
\item \ldots
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Why should I not use it?}
\end{pframe}
\subsection{Why should I not use it?}
\begin{pframe}
A list of common excuses:
\begin{itemize}
\item It is too much work.
......@@ -93,60 +88,53 @@
\begin{itemize}
\item I'm too busy rewriting the code I accidentally deleted.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Local repository.}
\end{pframe}
\subsection{Local repository}
\begin{pframe}
\begin{figure}[]
\begin{center}
\colorbox{white}{
\hspace{0.5cm}
\includegraphics[height=0.8\textheight]{pics/18333fig0101-tn}
\includegraphics[height=0.8\textheight]{18333fig0101-tn}
\hspace{0.5cm}
}
\end{center}
\caption{Local version control diagram.}
\label{}
\end{figure}
\end{frame}
\end{pframe}
\begin{frame}
\frametitle{Central repository.}
\subsection{Central repository}
\begin{pframe}
\begin{figure}[]
\begin{center}
\colorbox{white}{
\hspace{0.5cm}
\includegraphics[height=0.8\textheight]{pics/18333fig0102-tn}
\includegraphics[height=0.8\textheight]{18333fig0102-tn}
\hspace{0.5cm}
}
\end{center}
\caption{Centralised version control diagram.}
\label{}
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Distributed repositories.}
\end{pframe}
\subsection{Distributed repositories}
\begin{pframe}
\begin{figure}[]
\begin{center}
\colorbox{white}{
\hspace{0.5cm}
\includegraphics[height=0.8\textheight]{pics/18333fig0103-tn}
\includegraphics[height=0.8\textheight]{18333fig0103-tn}
\hspace{0.5cm}
}
\end{center}
\caption{Distributed version control diagram.}
\label{}
\end{figure}
\end{frame}
\end{pframe}
\section{Git}
\begin{frame}
\frametitle{The name.}
\subsection{The name}
\begin{pframe}
\emph{Git (n): A person who is deemed to be despicable or contemptible.} ---
WordNet.
\bigskip
......@@ -155,11 +143,10 @@
\emph{I'm an egotistical bastard, and I name all my projects after myself.
First ``Linux'', now ``git''.} --- Linus Torvalds.
\bigskip
\end{frame}
\begin{frame}
\frametitle{History.}
\end{pframe}
\subsection{History}
\begin{pframe}
Designed to replace the commercial package \emph{BitKeeper}.
\begin{itemize}
\item Speed.
......@@ -170,12 +157,11 @@
\item Able to handle large projects like the Linux kernel efficiently
(speed and data size).
\end{itemize}
\end{frame}
\end{pframe}
\section{Remotes}
\begin{fframe}
\frametitle{A lot of choices.}
\subsection{A lot of choices}
\begin{pframe}
GitHub.
\begin{itemize}
\item Only free for open source projects.
......@@ -196,25 +182,30 @@
\vfill
\permfoot{https://github.com/}
\end{fframe}
\end{pframe}
\section{Practical}
\begin{fframe}
\frametitle{Outline.}
\subsection{Outline}
\begin{pframe}
We are going to:
\begin{itemize}
\item Create and configure a user account on the GitLab server.
\item Upload an \bt{ssh-key} to work with Git.
\end{itemize}
\bigskip
Or alternatively, if you can not access the internal network:
\begin{itemize}
\item Use \bt{https} to work with GitLab.
\end{itemize}
\vfill
\permfoot{https://git.lumc.nl/}
\end{fframe}
\end{pframe}
\section{Questions?}
\lastpagetemplate
\begin{fframe}
\begin{pframe}
\begin{center}
Acknowledgements:
\bigskip
......@@ -222,12 +213,12 @@
Martijn Vermaat
Zuotian Tatum
Wibowo Arindrarto
Zuotian Tatum
\end{center}
\vfill
\permfoot{https://humgenprojects.lumc.nl/trac/humgenprojects/wiki/git}
\end{fframe}
\end{pframe}
\end{document}
......@@ -14,7 +14,7 @@ Git Introduction practical.
\end{center}
\bigskip
\subsubsection*{Local configuration.}
\subsubsection*{Local configuration}
First, let Git know what your name and e-mail address is:
\begin{lstlisting}
$ git config --global user.name "<Your Name>"
......@@ -23,6 +23,24 @@ First, let Git know what your name and e-mail address is:
\end{lstlisting}
\bigskip
For the other practicals, it is convenient to have a \texttt{projects} folder
for your repositories:
\begin{lstlisting}
mkdir ~/projects
cd ~/projects
\end{lstlisting}
\newcommand{\generalconfiguration}{
You can now edit your profile by clicking on the ``profile'' button
(pictogram of a torso), located on the top right of your screen. On mouse
over, a text balloon will pop up, saying ``Profile settings''.
\medskip
Check your name and e-mail address (you probably want to change your name).
\bigskip
}
\subsubsection*{Remote configuration for LUMC participants}
Check whether you have an ssh key:
\begin{lstlisting}
$ cat ~/.ssh/id_rsa.pub
......@@ -37,26 +55,46 @@ If not, make one:
Enter same passphrase again:
\end{lstlisting}
You can leave all fields blank.
\bigskip
\subsubsection*{Remote configuration.}
Open \texttt{https://git.lumc.nl} in your browser.
\bigskip
\medskip
In the authentication form, use your LUMC username and password (LDAP login).
\bigskip
You can now edit your profile by clicking on the ``profile'' button (pictogram
of a torso), located on the top right of your screen. On mouse over, a text
balloon will pop up, saying ``My profile''.
\generalconfiguration
To be able to upload new versions, you need to add your ssh key. Open the ``SSH
Keys'' tab and click the ``Add SSH Key'' button.
\medskip
Give your key a title (e.g., ``Course laptop'').
\medskip
Copy your ssh key to the key field (see the \texttt{cat} command above).
\subsubsection*{Remote configuration for other participants}
Open \texttt{https://git.lumc.nl} in your browser.
\bigskip
Check your name and e-mail address (you probably want to change your name).
In the authentication form, use the provided username and password (Standard
login).
\bigskip
To be able to upload new versions, you need to add your ssh key. Click the
``Add Public Key'' button.
\generalconfiguration
Give your key a title (e.g., ``Course Laptop'').
Open \texttt{https://git.lumc.nl/humgen/gitcourse} in your browser.
\bigskip
Copy your ssh key to the key field (see the \texttt{cat} command above).
On the right, you see a text box containing the string
\texttt{git@git.lumc.nl:humgen/gitcourse.git}, notice the ``SSH'' button is
selected. During the course we will ask you to use this protocol (ssh) for
remote repositories. Since we do not have access to the LUMC using this
protocol, we are going to use an other protocol.
\bigskip
Click the ``HTTPS'' button, and you will see the string
\texttt{https://git.lumc.nl/humgen/gitcourse.git}. We can use this protocol
(https) for remote repositories.
\end{document}
../pics/
\ No newline at end of file
......@@ -2,7 +2,7 @@
\title{Analysis projects skeleton}
\providecommand{\myConference}{Git course}
\providecommand{\myDate}{Monday, October 14, 2013}
\providecommand{\myDate}{Monday, June 23, 2014}
\author{Jeroen F. J. Laros}
\providecommand{\myGroup}{Leiden Genome Technology Center}
\providecommand{\myDepartment}{Department of Human Genetics}
......@@ -31,9 +31,8 @@
% First page of the presentation.
\section{Introduction}
\begin{frame}
\frametitle{Shared projects.}
\subsection{Shared projects}
\begin{pframe}
Most of us work on multiple projects with multiple people.
\bigskip
......@@ -48,12 +47,11 @@
\pause
\item Have the same structure for all projects.
\end{itemize}
\end{frame}
\end{pframe}
\section{Starting a project}
\begin{fframe}
\frametitle{Project skeleton.}
\subsection{Project skeleton}
\begin{pframe}
Usage:
\begin{itemize}
\item Make a \emph{fork} (copy) of the skeleton project.
......@@ -76,11 +74,10 @@
\vfill
\permfoot{https://git.lumc.nl/lgtc-bioinformatics/project-skeleton}
\end{fframe}
\end{pframe}
%\begin{fframe}
% \frametitle{Forking}
%
%\subsection{Forking}
%\begin{pframe}
% Make a new analysis project.
% \begin{itemize}
% \item Go to the ``Project skeleton'' project page on our GitLab server.
......@@ -93,11 +90,10 @@
%
% \vfill
% \permfoot{https://git.lumc.nl/lgtc-bioinformatics/project-skeleton}
%\end{fframe}
%\end{pframe}
%\begin{frame}
% \frametitle{Configuration}
%
%\subsection{Configuration}
%\begin{pframe}
% Configure your project.
% \begin{itemize}
% \item Choose to make your project public or not.
......@@ -107,12 +103,11 @@
% \end{itemize}
% \item Add the people that work on this project.
% \end{itemize}
%\end{frame}
%\end{pframe}
\section{Project structure}
\begin{frame}
\frametitle{Global overview.}
\subsection{Global overview}
\begin{pframe}
Project layout:
\begin{itemize}
\item analysis
......@@ -123,22 +118,20 @@
\bigskip
Ideally, every directory in the project has a \bt{README} file.
\end{frame}
\begin{frame}
\frametitle{The toplevel \bt{\,README\,\,} file.}
\end{pframe}
\subsection{The toplevel ``README'' file}
\begin{pframe}
This file contains general information about the project, for example:
\begin{itemize}
\item Who leads the project.
\item Who participates in the project.
\item The amount of hours people have spent on this project.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{The \bt{\,doc\,\,} directory.}
\end{pframe}
\subsection{The ``doc'' directory}
\begin{pframe}
Documentation on the project:
\begin{itemize}
\item Annotation of the data.
......@@ -148,11 +141,10 @@
\item You may want to note who provided the documentation.
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{The \bt{\,data\,\,} directory.}
\end{pframe}
\subsection{The ``data'' directory}
\begin{pframe}
Used to store all raw data.
\bigskip
......@@ -176,11 +168,10 @@
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{The \bt{\,analysis\,\,} directory.}
\end{pframe}
\subsection{The ``analysis'' directory}
\begin{pframe}
All analysis related files are stored here:
\begin{itemize}
\item Run scripts.
......@@ -195,22 +186,20 @@
\item Normal data analysis.
\item $k$-mer analysis.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{The \bt{\,src\,\,} directory.}
\end{pframe}
\subsection{The ``src'' directory}
\begin{pframe}
Any custom scripts and specific software versions for this project.
\bigskip
When these scripts are useful for other projects, move them to their own
repository.
\end{frame}
\end{pframe}
\section{Working with large files}
\begin{fframe}
\frametitle{Git is not designed for massive files.}
\subsection{Git is not designed for massive files}
\begin{pframe}
Some problems with large files:
\begin{itemize}
\item Limited storage on the server.
......@@ -231,11 +220,10 @@
\vfill
\permfoot{http://git-annex.branchable.com/}
\end{fframe}
\begin{frame}[fragile]
\frametitle{Git annex.}
\end{pframe}
\subsection{Git annex}
\begin{pframe}
Manage files with git, without checking their contents in.
\begin{itemize}
\item Manage large files without storing them.
......@@ -251,11 +239,10 @@
\begin{lstlisting}[language=none, caption=Enable git-annex.]
$ git annex init "<name>"
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
\frametitle{Adding big files.}
\end{pframe}
\subsection{Adding big files}
\begin{pframe}
In our master repository, we annex a file.
\bigskip
......@@ -274,11 +261,10 @@
<filename>: broken symbolic link to ...
$ git annex get <filename>
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
\frametitle{Removing files.}
\end{pframe}
\subsection{Removing files}
\begin{pframe}
As long as there are enough copies available, you can remove files.
\bigskip
......@@ -297,11 +283,10 @@
$ rm -rf <repository>
rm: cannot remove <repository>/.git/annex/objects/...
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
\frametitle{Synchronise your results.}
\end{pframe}
\subsection{Synchronise your results}
\begin{pframe}
Let the other repositories know what you have done.
\bigskip
......@@ -317,11 +302,10 @@
\begin{lstlisting}[language=none, caption=Synchronise with a selection.]
$ git annex sync origin
\end{lstlisting}
\end{frame}
\begin{frame}[fragile]
\frametitle{Working together on the same clone.}
\end{pframe}
\subsection{Working together on the same clone}
\begin{pframe}
Sometimes you need to work with other people on the same repository clone.
\begin{itemize}
\item Where the large files are stored.
......@@ -335,11 +319,11 @@
$ find -type d -exec chmod 775 {} \;
$ find -type f -exec chmod 664 {} \;
\end{lstlisting}
\end{frame}
\end{pframe}
\section{Questions?}
\lastpagetemplate
\begin{fframe}
\begin{pframe}
\begin{center}
Acknowledgements:
\bigskip
......@@ -353,7 +337,7 @@
\vfill
\permfoot{http://git-annex.branchable.com/}
\permfoot{https://git.lumc.nl/lgtc-bioinformatics/project-skeleton}
\end{fframe}
\permfoot{https://git.lumc.nl/lgtc-bioinformatics/project-skeleton}
\end{pframe}
\end{document}
{"username": "jfjlaros", "info": {"git": [15, "e7cdcdf9234d9e40e42159594b5ba041"]}, "protocol": "https", "location": "humgenprojects.lumc.nl/trac/humgenprojects"}
\ No newline at end of file
#!/bin/sh
src="introduction basics branching remotes skeleton program"
for i in $src; do
cd ../$i
make
mv *.pdf ../website/
make distclean
done
cd ../website
tracwiki commit git
tracwiki attach git *.pdf data.tgz
tracwiki commit git__SLASH__SoftwareInstallation
= Git introduction course =
= Version control with Git course =
This course aims at everyone who works in the Bioinformatics field. We cover a
''version control system'' named ''Git''. This system is widely used by
......@@ -6,10 +6,21 @@ software developers, but can also be used for project management. By keeping
track of all versions, history, etc. collaboration with colleagues is easy and
your analysis will be reproducible.
The program can be found [raw-attachment:program.pdf here].
The next installment will be on '''June 23'''. Registration is required and handled by MGC. [http://www.medgencentre.nl/ Register at their website].
The June 23, 2014 program can be found [raw-attachment:program.pdf here].
== Prerequisites ==
Affinity with the UNIX shell is required before taking the course. For example, our [wiki:scripting scripting course] is more than enough, or you could go though [http://www.ee.surrey.ac.uk/Teaching/Unix/ tutorials 1-3 here].
We can provide you with a laptop that has all the required software installed. You can also use your own laptop, but make sure it has the necessary software installed (see [wiki:git/SoftwareInstallation Software installation]). The lessons are interactive, meaning that you really need a laptop.
== Course material ==
'''Note: most of this is not yet updated from last year's course.'''
Introduction [raw-attachment:introduction.pdf presentation],
[raw-attachment:introduction_handouts.pdf practical]. [[br]]
Git Basics [raw-attachment:basics.pdf presentation],
......@@ -23,10 +34,19 @@ Project skeleton / `git-annex`
[raw-attachment:skeleton_handouts.pdf practical],
[raw-attachment:data.tgz data].
[https://git.lumc.nl/j.f.j.laros/gitcourse Material sources].
[https://git.lumc.nl/humgen/gitcourse Material sources].
== Further reading ==
[http://git-scm.com/book The entire Pro Git book] on the official [http://git-scm.com/ Git website]. [[br]]
[http://rypress.com/tutorials/git/index.html Ry's Git Tutorial]. [[br]]
[https://www.atlassian.com/git/tutorial Git tutorials at Atlassian]. [[br]]
[https://git.wiki.kernel.org/index.php/GitCheatSheet Git cheat sheet].
\ No newline at end of file
- [https://try.github.io/ Code School - Try Git] (you could even try this before the course)
- [http://git-scm.com/book The entire Pro Git book] on the official [http://git-scm.com/ Git website]
- [http://rypress.com/tutorials/git/index.html Ry's Git Tutorial]
- [https://www.atlassian.com/git/tutorial Git tutorials at Atlassian]
- [http://pcottle.github.io/learnGitBranching/ Learn Git Branching]
- [https://git.wiki.kernel.org/index.php/GitCheatSheet Git cheat sheet] (useful for printing)
== Contact ==
Please contact [mailto:m.vermaat.hg@lumc.nl Martijn Vermaat] if you have any questions or comments.
\ No newline at end of file
= Software installation =
We assume you have a system with all software listed below installed '''before''' the course starts.
If you're in the Human Genetics department, Michel can help you by installing all this on your LUMC computer. Simply mention ''git course''.
We work with [http://en.wikipedia.org/wiki/Linux Linux], more specifically Ubuntu (12.04 Quantal Quetzal or later) or Debian Linux (7/Wheezy or later). Git also runs on Windows and Mac OSX, so if you manage to install it on there that's also fine (but note that during the course we will assume Linux).
You can [http://www.ubuntu.com/ download Ubuntu here] and either install it directly on your laptop, or run it inside [https://www.virtualbox.org/ VirtualBox].
We need some system packages to be installed. For the following command, you need sudo rights:
{{{
sudo apt-get install -y git gitg git-annex
}}}
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