Formation git

This commit is contained in:
2015-07-15 20:52:22 +02:00
parent dbd84ec3a0
commit 232473472a
65 changed files with 2317 additions and 116 deletions

View File

@ -19,7 +19,9 @@
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{hyperxmp}
\usepackage{minted}
\usepackage{tikz}
\usepackage{gitdags}
%\usepackage{pstricks}
%\usepackage{pst-3d,pst-coil,pst-eps,pst-fill,pst-grad,pst-node,pst-plot,pst-text,pst-tree}
@ -56,10 +58,12 @@
\setbeamertemplate{background}
{\skbinput[from=fig]{cadoles/gray_frame_background}}
\newcommand{\commande}[1]{\texttt{#1}}
\title[]{Formation Git}
\subtitle{Oberthur Cash Protection}
\author[Equipe Auteur]{Cadoles}
\author[Equipe Auteur]{Benjamin Bohard}
\institute[Cadoles]{\skbfigure[width=2cm]{cadoles/logo_01.png}}
@ -90,12 +94,10 @@
\begin{document}
\skbinput[from=rep]{style/title}
\begin{frame}
\frametitle{Plan}
\tableofcontents[part=1, pausesections]
\end{frame}
\part{Fondamentaux}
\frame{\partpage}
\frame{\tableofcontents[part=1]}
\section{Qu'attendre d'un SCM ?}
\skbinput[from=rep]{outils/scm/definition}
\skbinput[from=rep]{outils/scm/fonctionnalites_attendues}
@ -107,41 +109,44 @@
\skbinput[from=rep]{outils/scm/workflow/branching}
\skbinput[from=rep]{outils/scm/workflow/driessen}
\skbinput[from=rep]{outils/scm/workflow/driessen/schema}
\part{Pratique}
\skbinput[from=rep]{commun/questions}
\part{Préparation}
\frame{\partpage}
\section{Installation}
\subsection{Côté \emph{client}}
\skbinput[from=rep]{outils/scm/git/installation/windows}
\skbinput[from=rep]{outils/scm/git/installation/macos}
\skbinput[from=rep]{outils/scm/git/installation/linux}
\subsection{Côté \emph{serveur}}
\skbinput[from=rep]{outils/scm/git/web/basicssh}
\skbinput[from=rep]{outils/scm/git/web/gitolite}
\skbinput[from=rep]{outils/scm/git/web/gitlab}
\skbinput[from=rep]{outils/scm/git/web/gogs}
\section{Configuration}
\subsection{Utilisateur}
\skbinput[from=rep]{outils/scm/git/configuration/presentation}
\skbinput[from=rep]{outils/scm/git/configuration/user}
\skbinput[from=rep]{outils/scm/git/configuration/alias}
\subsection{Dépôts}
\skbinput[from=rep]{outils/scm/git/configuration/gitignore}
\skbinput[from=rep]{outils/scm/git/commandes/remote/add}
\skbinput[from=rep]{outils/scm/git/commandes/branch/track}
\section{Ergonomie}
\subsection{Ergonomie}
\skbinput[from=rep]{outils/scm/git/configuration/alias}
\skbinput[from=rep]{outils/scm/git/configuration/editeur}
\skbinput[from=rep]{outils/scm/git/configuration/bash}
\section{Commandes}
\subsection{Pour démarrer un projet}
\skbinput[from=rep]{outils/scm/git/configuration/shell}
\subsection{Hooks}
\skbinput[from=rep]{outils/scm/git/configuration/hooks}
\part{Récapitulatif des commandes}
\frame{\partpage}
\section{Pour démarrer un projet}
\skbinput[from=rep]{outils/scm/git/commandes/init}
\skbinput[from=rep]{outils/scm/git/commandes/clone}
\subsection{Pour faire le point}
\section{Pour faire le point}
\skbinput[from=rep]{outils/scm/git/commandes/status}
\skbinput[from=rep]{outils/scm/git/commandes/diff}
\skbinput[from=rep]{outils/scm/git/commandes/log}
\skbinput[from=rep]{outils/scm/git/commandes/cherry}
\skbinput[from=rep]{outils/scm/git/commandes/show}
\skbinput[from=rep]{outils/scm/git/commandes/bisect}
\skbinput[from=rep]{outils/scm/git/commandes/ls-files}
\skbinput[from=rep]{outils/scm/git/commandes/blame}
\subsection{Pour modifier le contenu du dépôt}
\skbinput[from=rep]{outils/scm/git/stockage}
\section{Pour modifier le contenu du dépôt}
\skbinput[from=rep]{outils/scm/git/commandes/checkout}
\skbinput[from=rep]{outils/scm/git/commandes/pull}
\skbinput[from=rep]{outils/scm/git/commandes/fetch}
@ -150,42 +155,46 @@
\skbinput[from=rep]{outils/scm/git/commandes/add}
\skbinput[from=rep]{outils/scm/git/commandes/reset}
\skbinput[from=rep]{outils/scm/git/commandes/clean}
\skbinput[from=rep]{outils/scm/git/commandes/commit}
\skbinput[from=rep]{outils/scm/git/commandes/cherry-pick}
\skbinput[from=rep]{outils/scm/git/commandes/revert}
\skbinput[from=rep]{outils/scm/git/commandes/push}
\subsection{Pour organiser son développement}
\skbinput[from=rep]{outils/scm/git/commandes/filter-branch}
\section{Pour organiser son développement}
\skbinput[from=rep]{outils/scm/git/commandes/branch}
\skbinput[from=rep]{outils/scm/git/commandes/tag}
\section{Mise en pratique}
\subsection{Mise en place}
\section{Aide-mémoire}
\skbinput[from=rep]{outils/scm/git/commandes}
\part{Mise en pratique}
\frame{\partpage}
\section{Mise en place}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_01}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_01/steps}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_02}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_02/steps}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_03}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_03/steps}
\subsection{Dépôt individuel}
\section{Dépôt individuel}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_04}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_04/steps}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_05}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_05/steps}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_06}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_06/steps}
\subsection{Dépôt commun}
\section{Dépôt commun}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_07}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_07/steps}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_08}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_08/steps}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_09}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_09/steps}
\subsection{Paquet debian}
\section{Paquet debian}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_10}
\skbinput[from=rep]{outils/scm/git/exercices/exercice_10/steps}
\section{Pour aller plus loin}
\part{Pour aller plus loin}
\frame{\partpage}
\skbinput[from=rep]{outils/scm/git/references/references}
\section{licence}
\part{licence}
\skbinput[from=rep]{licences/license-cc-by-sa-2.0}
\end{document}

View File

@ -0,0 +1,279 @@
%%
%% Copyright (C) 2014 by Julien Cretel <jubobs.tex at gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Julien Cretel.
%%
%% This work currently consists of the file gitdags.sty.
%%
\NeedsTeXFormat{LaTeX2e}[2011/06/27]
\ProvidesClass{gitdags}
[2014/08/28 v0.1 A package for drawing educational Git history graphs]
\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{tikz}}
\ProcessOptions\relax
\RequirePackage{xcolor-solarized}
\RequirePackage{tikz}
\usetikzlibrary{
arrows.meta,
graphs,
positioning,
shadows,
shapes,
}
% conflict color
\colorlet{conflictcolor}{red}
% custom shape, adapted from 102.5.3 in the TikZ 3.0 manual
\pgfdeclareshape{dogeared}{
\inheritsavedanchors[from=rectangle]
\inheritanchorborder[from=rectangle]
\inheritanchor[from=rectangle]{center}
\inheritanchor[from=rectangle]{north}
\inheritanchor[from=rectangle]{south}
\inheritanchor[from=rectangle]{west}
\inheritanchor[from=rectangle]{east}
\backgroundpath{%
\southwest \pgf@xa=\pgf@x \pgf@ya=\pgf@y
\northeast \pgf@xb=\pgf@x \pgf@yb=\pgf@y
\pgf@xc=\pgf@xb \advance\pgf@xc by-5pt
\pgf@yc=\pgf@yb \advance\pgf@yc by-5pt
\pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
\pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@ya}}
\pgfpathclose
\pgfpathmoveto{\pgfpoint{\pgf@xc}{\pgf@yb}}
\pgfpathlineto{\pgfpoint{\pgf@xc}{\pgf@yc}}
\pgfpathlineto{\pgfpoint{\pgf@xb}{\pgf@yc}}
\pgfpathclose
}
}
% To cancel a shadow (see http://tex.stackexchange.com/a/198298/21891)
\tikzset{reset preaction/.code={\def\tikz@preactions{}}}
% --- repository history graphs ---
% style definitions
\tikzset{
gitdags node/.style={
draw,
node distance = 1.4em,
drop shadow = {opacity=0.15},
font = \fontfamily{lmtt}\selectfont\small,
},
DAGref/.style={
gitdags node,
shape = rectangle,
minimum height = 1.4em,
draw = solarized-base01,
thick,
font = \fontfamily{lmtt}\selectfont\scriptsize,
},
DAGedge/.style={
semithick,
Latex-,
draw = gray,
},
DAGrefedge/.style={
DAGedge,
thick,
densely dotted,
},
DAGcommit/.style={
gitdags node,
shape = rounded rectangle,
rounded rectangle arc length = 90,
minimum height = 1.6em,
minimum width = 2em,
draw = solarized-base01,
fill = solarized-green!20,
very thick,
},
graphs/DAG/.style={
nodes = DAGcommit,
edges = DAGedge,
branch down = 3em,
grow right sep = 1.5em,
},
gitareas/.style={
gitdags node,
shape = rectangle,
rounded corners = .5em,
minimum width = 7em,
minimum height = 3em,
text opacity = 0.75,
semithick,
},
gitSA/.style={
gitareas,
anchor = north west,
xshift = 1em,
yshift = -1em,
draw = solarized-orange,
fill = solarized-orange!5,
text = solarized-orange,
},
gitWT/.style={
gitareas,
node distance = .6em,
draw = solarized-violet,
fill = solarized-violet!5,
text = solarized-violet,
},
resetarrows/.style={
-Stealth,
dashed,
thick,
draw = solarized-base02,
draw opacity = .75,
},
highlighted commit/.style={
DAGcommit,
reset preaction,
fill opacity = 0,
draw = solarized-base02,
},
problematic commits/.style={
reset preaction,
draw opacity = .25,
fill opacity = .25,
},
graphs/unreachable/.style={
problematic commits,
target edge style = problematic commits,
},
graphs/conflict/.style={
empty nodes,
problematic commits,
target edge style = problematic commits,
draw = conflictcolor,
fill = conflictcolor!25,
},
placeholder commits/.style={
reset preaction,
draw opacity = 0,
fill opacity = 0,
},
graphs/placeholder/.style={
placeholder commits,
target edge style = placeholder commits,
},
blob/.style={
shape = dogeared,
minimum width = 2em,
minimum height = 2.82em,
node distance = .75em,
line join = bevel,
draw = black,
fill = white,
align = left,
font = \ttfamily\tiny,
},
}
% directed acyclic graph
\newcommand\gitDAG[1][]{\graph[DAG,#1]}
% helper macro (let's check the name's availability)
\newcommand\nodename@gitdags{}
% local-branch reference
\newcommand\gitbranch[4][]{%
\renewcommand\nodename@gitdags{#1}%
\if\relax\detokenize{#1}\relax% check for empty optional argument
\renewcommand\nodename@gitdags{#2}%
\fi
\node[
DAGref,
fill = yellow!30,
] (\nodename@gitdags) [#3] {#2};
\draw[DAGrefedge] (#4) -- (\nodename@gitdags);
}
% remote-branch reference
\newcommand\gitremotebranch[4][]{%
\renewcommand\nodename@gitdags{#1}%
\if\relax\detokenize{#1}\relax% check for empty optional argument
\renewcommand\nodename@gitdags{#2}%
\fi
\node[
DAGref,
fill = solarized-blue!20,
] (\nodename@gitdags) [#3] {#2};
\draw[DAGrefedge] (#4) -- (\nodename@gitdags);
}
% tag reference
\newcommand\gittag[4][]{%
\renewcommand\nodename@gitdags{#1}%
\if\relax\detokenize{#1}\relax% check for empty optional argument
\renewcommand\nodename@gitdags{#2}%
\fi
\node[
DAGref,
fill = solarized-magenta!20,
] (\nodename@gitdags) [#3] {#2};
\draw[DAGrefedge] (#4) -- (\nodename@gitdags);
}
% HEAD symbolic reference
\newcommand\gitHEAD[2]{%
\node[
DAGref,
fill = solarized-red!20,
node distance = 1em,
] (gitHEAD) [#1] {HEAD};
\draw[DAGrefedge] (#2) -- (gitHEAD);
}
% the following macro is useful for explaining how merge conflicts arise
\newcommand\gitblob[2][]
{\node[blob,#1] {#2};}
% to highlight a merge conflict arising in a given file
\newcommand\gitblobmc[1]{%
\node[
blob,
draw = conflictcolor,
text = conflictcolor,
font = \scriptsize,
#1] {???};
}
% staging area and worktree
\newcommand\SAandWT{%
\node[
gitSA,
] (stagingarea) at (current bounding box.south east) {staging area};
\node[
gitWT,
below=of stagingarea,
] (workingtree) {working tree};
}
% arrows pointing from a commit to the staging area or working tree
\newcommand\toSAorWT[2]{%
\node[highlighted commit] at (#1) {\phantom{#1}};
\draw[resetarrows] (#1.south) to[out=290, in=170]
([xshift=1em,yshift=-1em]#2.north west);
}
\newcommand\toSAfrom[1]{\toSAorWT{#1}{stagingarea}}
\newcommand\toWTfrom[1]{\toSAorWT{#1}{workingtree}}
\endinput

View File

@ -0,0 +1,92 @@
%%
%% This is file `xcolor-solarized.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xcolor-solarized.dtx (with options: `package')
%%
%% This is a generated file.
%%
%% Copyright (C) 2014 by Julien Cretel <jubobs.tex at gmail.com>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%
%% http://www.latex-project.org/lppl.txt
%%
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Julien Cretel.
%%
%% This work currently consists of the files xcolor-solarized.dtx,
%% xcolor-solarized.ins, and the derived file xcolor-solarized.sty.
%%
\NeedsTeXFormat{LaTeX2e}[2011/06/27]
\ProvidesPackage{xcolor-solarized}
[2015/02/17 v0.3 xcolor definitions for Ethan Schoonover's
Solarized theme]
\RequirePackage{xcolor}[2007/01/21]
\RequirePackage{kvoptions}[2011/06/30]
\SetupKeyvalOptions{
family=solarized,
prefix=solarized@
}
\DeclareStringOption[solarized-]{prefix}
\DeclareDefaultOption{%
\OptionNotUsed
\PackageError{xcolor-solarized}{Unknown `\CurrentOption' option}
}
\ProcessKeyvalOptions*
\newcommand\solarized@definecolor{\expandafter\definecolor\expandafter}
\solarized@definecolor{\solarized@prefix base03} {RGB}{000, 043, 054}
\solarized@definecolor{\solarized@prefix base02} {RGB}{007, 054, 066}
\solarized@definecolor{\solarized@prefix base01} {RGB}{088, 110, 117}
\solarized@definecolor{\solarized@prefix base00} {RGB}{101, 123, 131}
\solarized@definecolor{\solarized@prefix base0} {RGB}{131, 148, 150}
\solarized@definecolor{\solarized@prefix base1} {RGB}{147, 161, 161}
\solarized@definecolor{\solarized@prefix base2} {RGB}{238, 232, 213}
\solarized@definecolor{\solarized@prefix base3} {RGB}{253, 246, 227}
\solarized@definecolor{\solarized@prefix yellow} {RGB}{181, 137, 000}
\solarized@definecolor{\solarized@prefix orange} {RGB}{203, 075, 022}
\solarized@definecolor{\solarized@prefix red} {RGB}{220, 050, 047}
\solarized@definecolor{\solarized@prefix magenta}{RGB}{211, 054, 130}
\solarized@definecolor{\solarized@prefix violet} {RGB}{108, 113, 196}
\solarized@definecolor{\solarized@prefix blue} {RGB}{038, 139, 210}
\solarized@definecolor{\solarized@prefix cyan} {RGB}{042, 161, 152}
\solarized@definecolor{\solarized@prefix green} {RGB}{133, 153, 000}
\newcommand\solarizedPalette[1][3em]{%
\newcommand\solarized@square{\rule{#1}{#1}}
\noindent
\begin{tabular}{cccc cccc}
\textcolor{solarized-base03} \solarized@square &
\textcolor{solarized-base02} \solarized@square &
\textcolor{solarized-base01} \solarized@square &
\textcolor{solarized-base00} \solarized@square &
\textcolor{solarized-base0} \solarized@square &
\textcolor{solarized-base1} \solarized@square &
\textcolor{solarized-base2} \solarized@square &
\textcolor{solarized-base3} \solarized@square \\
base03 & base02 & base01 & base00 &
base0 & base1 & base2 & base3 \\[#1]
\textcolor{solarized-yellow} \solarized@square &
\textcolor{solarized-orange} \solarized@square &
\textcolor{solarized-red} \solarized@square &
\textcolor{solarized-magenta}\solarized@square &
\textcolor{solarized-violet} \solarized@square &
\textcolor{solarized-blue} \solarized@square &
\textcolor{solarized-cyan} \solarized@square &
\textcolor{solarized-green} \solarized@square \\
yellow & orange & red & magenta &
violet & blue & cyan & green
\end{tabular}
}
\endinput
%%
%% End of file `xcolor-solarized.sty'.