Commit efa87d5c authored by Mihai's avatar Mihai

Moved common parts to shared and started basics update

parent a9fc77c5
......@@ -2,13 +2,13 @@
\input{../shared/shared.tex}
\author{Jeroen F.J. Laros}
\author{}
\title{\courseTitle}
\providecommand{\mySubTitle}{Git Basics}
\providecommand{\myConference}{\courseTitle}
\providecommand{\myGroup}{}
\providecommand{\myDepartment}{Department of Human Genetics}
\providecommand{\myCenter}{Center for Human and Clinical Genetics}
\providecommand{\myCenter}{}
\usetheme{lumc}
......@@ -18,62 +18,97 @@
%\renewcommand{\pause}{}
% Make the title slide.
\makeTitleSlide{\includegraphics[width=3.5cm]{git_logo}}
\makeTitleSlide{\includegraphics[width=3.5cm]{../shared/git_logo.pdf}}
% First page of the presentation.
\section{Initialisation}
\subsection{Starting a project}
\section{Starting a project}
\subsection{You can either}
\begin{pframe}
Creating a new repository is easy. You do not need a server, no registration,
etc.
\begin{lstlisting}[language=none, caption=Make a new repository.]
$ cd ~/projects
$ git init
Initialized empty Git repository in <path>/.git/
\end{lstlisting}
1. Start from scratch on your own:
\vspace{-0.3cm}
\begin{framed}
\prompt\ \cmd{mkdir}\ \cmdarg{my\_project}\\
\prompt\ \cmd{cd}\ \cmdarg{my\_project}\\
\prompt\ \gitcmd\ \cmd{init}\\
\cliout{Initialized empty Git repository in \{current-directory\}\/.git\/}
\end{framed}
\pause
Or you can ``clone'' an existing repository.
\begin{lstlisting}[language=none, caption=Clone an existing repository.]
$ git clone <path-to-repository>
\end{lstlisting}
2. Or you can \cmd{clone} an existing remote (or local) repository:
\vspace{-0.3cm}
\begin{framed}
\prompt\ \gitcmd\ \cmd{clone}\ \cmdarg{\<path-to-repository\>}\\
\cliout{Cloning into \{repo-name\} ...}
\end{framed}
\end{pframe}
\subsection{Where does git store its repository information?}
\begin{pframe}
You can see a hidden directory in a Git repository.
\begin{lstlisting}[language=none, caption=A hidden directory is added.]
$ ls -a
. .. .git
\end{lstlisting}
\vspace{-0.3cm}
\begin{framed}
\prompt\ \cmd{ls}\ \cmdopt{-a}\\
\cliout{. .. .git}
\end{framed}
This is where git stores the files necessary to track your progress. You
rarely need to edit the contents of this directory.
\bigskip
This directory contains almost everything that Git stores and manipulates.
\important{Removing this directory means removing your repository!}
\end{pframe}
\section{Manipulation}
\subsection{Local operations}
\section{Git Operations}
\begin{pframe}
\begin{figure}[]
\vspace{-0.9cm}
Operations can be local or remote.\\
Most importantly, they track files around these three areas
\footnote[1]{\scriptsize{Adapted from
\href{http://git-scm.com/book/en/v2/Getting-Started-Git-Basics}
{Pro Git Book}.}}:
\begin{center}
\includegraphics[height=0.7\textheight]{18333fig0106-tn}
\includegraphics[width=0.7\textwidth]{images/git_areas.pdf}\\
\end{center}
\caption{Working directory, staging area, and Git directory.}
\end{figure}
\end{pframe}
\subsection{Checking the status of your files}
\subsection{Prelude: quick setup}
\begin{pframe}
\begin{lstlisting}[language=none, caption=Check status.]
$ git status
nothing to commit (working directory clean)
\end{lstlisting}
If you have never used \gitcmd\ before you need to tell it who you are. This
information is saved in \cmdarg{.gitconfig}\ and used to mark each commit.
\vspace{-0.4cm}
\begin{framed}
\prompt\ \gitcmd\ \cmd{config}\ \cmdopt{--global user.name}\
\cmdarg{\{your-name-or-nick-name\}}\\
\prompt\ \gitcmd\ \cmd{config}\ \cmdopt{--global user.email}\
\cmdarg{\{your-email-address\}}
\end{framed}
\pause
\vspace{-0.2cm}
Local configuration for each repository is possible as well.
\vspace{-0.4cm}
\begin{framed}
\prompt\ \gitcmd\ \cmd{config}\ \cmdopt{--local user.name}\
\cmdarg{\{your-name-or-nick-name\}}\\
\prompt\ \gitcmd\ \cmd{config}\ \cmdopt{--local user.email}\
\cmdarg{\{your-email-address\}}
\end{framed}
\vspace{-0.2cm}
\pause
``\lstinline{git status}'' can tell you whether your files are:
\begin{itemize}
\item Untracked.
\item Unmodified.
\item Modified.
\item Staged.
\end{itemize}
You would like colored output?
\vspace{-0.4cm}
\begin{framed}
\prompt\ \gitcmd\ \cmd{config}\ \cmdopt{--global color.ui}\ \cmdarg{auto}
\end{framed}
\end{pframe}
\subsection{Checking the status of your files}
\begin{pframe}
\begin{framed}
\prompt\ \gitcmd\ \cmd{status}\\
\cliout{nothing to commit (working directory clean)}
\end{framed}
\end{pframe}
\begin{pframe}
......
This diff is collapsed.
......@@ -12,25 +12,6 @@
\providecommand{\myDepartment}{Department of Human Genetics}
\providecommand{\myCenter}{Center for Human and Clinical Genetics}
\definecolor{cblack}{rgb}{0,0,0}
\definecolor{cwhite}{rgb}{1,1,1}
\definecolor{command-color}{rgb}{0,0.5,0}
\definecolor{git-color}{rgb}{0.94,0.23,0.18}
\definecolor{option-color}{rgb}{0.9,0.2,0.11}
\definecolor{argument-color}{rgb}{0.11,0.27,0.7}
\definecolor{pattern-color}{rgb}{0,0.5,0.5}
\definecolor{wildcard-color}{rgb}{0.75,0.3,0}
\definecolor{cli-text}{rgb}{0.15,0.15,0.15}
\definecolor{important-note}{rgb}{0.69,0.13,0.13}
\definecolor{redirection}{rgb}{0.99,0.13,0.13}
\definecolor{shadecolor}{rgb}{0.9,0.9,0.9}
\definecolor{one-dot}{rgb}{0.9,0.2,0.0}
\definecolor{two-dots}{rgb}{0.11,0.11,0.8}
\definecolor{slash}{rgb}{0.3,0.3,0.3}
\definecolor{head}{HTML}{B22222}
\definecolor{branch}{HTML}{20b2aa}
\definecolor{commit-id}{HTML}{b8860b}
\usetheme{lumc}
......
\usepackage{framed}
\providecommand{\courseTitle}{Code and data management with Git}
\providecommand{\myDate}{22-11-2017}
\providecommand{\acknowledgements}{
......@@ -6,3 +8,31 @@
Szymon Kie{\l}basa\\
Jeroen Laros\\
}
\definecolor{cblack}{rgb}{0,0,0}
\definecolor{cwhite}{rgb}{1,1,1}
\definecolor{command-color}{rgb}{0,0.5,0}
\definecolor{git-color}{rgb}{0.94,0.23,0.18}
\definecolor{option-color}{HTML}{483d8b}
\definecolor{argument-color}{rgb}{0.11,0.27,0.7}
\definecolor{pattern-color}{rgb}{0,0.5,0.5}
\definecolor{wildcard-color}{rgb}{0.75,0.3,0}
\definecolor{cli-text}{rgb}{0.15,0.15,0.15}
\definecolor{important-note}{rgb}{0.69,0.13,0.13}
\definecolor{redirection}{rgb}{0.99,0.13,0.13}
\definecolor{shadecolor}{rgb}{0.9,0.9,0.9}
\definecolor{one-dot}{rgb}{0.9,0.2,0.0}
\definecolor{two-dots}{rgb}{0.11,0.11,0.8}
\definecolor{slash}{rgb}{0.3,0.3,0.3}
\definecolor{head}{HTML}{B22222}
\definecolor{branch}{HTML}{20b2aa}
\definecolor{commit-id}{HTML}{b8860b}
\newcommand{\gitcmd}{\textcolor{git-color}{\lstinline{git}}}
\newcommand{\prompt}{\lstinline{$}}
\newcommand{\cmd}[1]{\textcolor{command-color}{\lstinline{#1}}}
\newcommand{\cmdarg}[1]{\textcolor{argument-color}{\lstinline{#1}}}
\newcommand{\cmdopt}[1]{\textcolor{option-color}{\lstinline{#1}}}
\newcommand{\cliout}[1]{\textcolor{cli-text}{\lstinline{#1}}}
\newcommand{\important}[1]{\textbf{\textcolor{important-note}{#1}}}
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