formations/content/outils/scm/git/exercices/exercice_06/steps.tex

220 lines
6.5 KiB
TeX
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

\begin{frame}
\frametitle{Utiliser les branches}
\framesubtitle{Créer une branche}
On créé une branche qui contiendra le fichier password.
\commande{git checkout -b branche\_indiscrete}
équivalent de la succession de commandes :
\begin{enumerate}
\item \commande{git branch branche\_indiscrete}
\item \commande{git checkout branche\_indiscrete}
\end{enumerate}
\begin{tikzpicture}
\gitDAG[grow right sep = 1em]{
A -- B};
\gitbranch{master}{above=of B}{B}
\gitHEAD{above=of master}{master}
\end{tikzpicture}
\begin{tikzpicture}
\gitDAG[grow right sep = 1em]{
A -- B};
\gitbranch{master}{above=of B}{B}
\gitHEAD{above=of master}{master}
\gitbranch[brindis]{brancheindiscrete}{below=of B}{B}
\end{tikzpicture}
\begin{tikzpicture}
\gitDAG[grow right sep = 1em]{
A -- B};
\gitbranch{master}{above=of B}{B}
\gitbranch[brindis]{brancheindiscrete}{below=of B}{B}
\gitHEAD{below=of brindis}{brindis}
\end{tikzpicture}
\end{frame}
\begin{frame}
\frametitle{Utiliser les branches}
\frametitle{Aparté}
\commande{git add password}
\commande{git commit -m "le fichier indésirable"}
\end{frame}
\begin{frame}
\frametitle{Utiliser les branches}
\frametitle{Aparté}
\commande{git log master..branche\_indiscrete}
\commande{git log master..}
\commande{git reflog}
\end{frame}
\begin{frame}
\frametitle{Utiliser les branches}
\framesubtitle{Merge}
\commande{git checkout master}
\commande{git branch merge/automatique}
\commande{git branch merge/conflit}
\commande{git branch merge/rebase}
% \begin{tikzpicture}
% \gitDAG[grow down sep = 1em]{
% A -- B};
% \gitbranch{master}{left=of B}{B}
% \gitHEAD{left=of master}{master}
% \gitbranch[auto]{merge/automatique}{right=of master}{B}
% \gitbranch[conflit]{merge/conflit}{right=of auto}{B}
% \gitbranch[rebase]{merge/rebase}{right=of conflit}{B}
% \end{tikzpicture}
\end{frame}
\begin{frame}
\frametitle{Utiliser les branches}
\framesubtitle{Merge}
\commande{git checkout merge/automatique}
\commande{cp doc/README\{,.md\}}
\commande{git add doc/}
\commande{git commit -m "Copie du fichier"}
% \begin{tikzpicture}
% \gitDAG[grow down sep = 1em]{
% A -- B --{C}};
% \gitbranch{master}{right=of B}{B}
% \gitHEAD{left=of auto}{auto}
% \gitbranch[auto]{merge/automatique}{left=of C}{C}
% \gitbranch[conflit]{merge/conflit}{right=of master}{B}
% \gitbranch[rebase]{merge/rebase}{right=of conflit}{B}
% \end{tikzpicture}
\end{frame}
\begin{frame}
\frametitle{Utiliser les branches}
\framesubtitle{Merge}
\commande{git checkout merge/conflit}
Édition du fichier doc/README
\commande{git commit -am "Des ennuis en perspective"}
% \begin{tikzpicture}
% \gitDAG[grow down sep = 1em]{
% A -- B --{C, D}};
% \gitbranch{master}{right=of B}{B}
% \gitHEAD{left=of conflit}{conflit}
% \gitbranch[auto]{merge/automatique}{right=of C}{C}
% \gitbranch[conflit]{merge/conflit}{left=of D}{D}
% \gitbranch[rebase]{merge/rebase}{right=of master}{B}
% \end{tikzpicture}
\end{frame}
\begin{frame}
\frametitle{Utiliser les branches}
\framesubtitle{Merge}
\commande{git checkout merge/rebase}
Édition du fichier doc/README
\commande{git commit -am "Des ennuis en perspective"}
% \begin{tikzpicture}
% \gitDAG[grow right sep = 1em]{
% A -- B --{C, D, E}};
% \gitbranch{master}{above=of B}{B}
% \gitHEAD{above=of rebase}{rebase}
% \gitbranch[auto]{merge/automatique}{above=of C}{C}
% \gitbranch[conflit]{merge/conflit}{above=of D}{D}
% \gitbranch[rebase]{merge/rebase}{above=of E}{E}
% \end{tikzpicture}
\end{frame}
\begin{frame}
\frametitle{Utiliser les branches}
\framesubtitle{Merge}
\commande{git checkout master}
Édition du fichier doc/README pour ajouter des alias
\commande{git commit -am "Des ennuis en perspective"}
Pour chaque branche merge/*, tenter la commande :
\commande{git merge merge/<nom>}
\end{frame}
\begin{frame}
\frametitle{Utiliser les branches}
\framesubtitle{Rebase}
\commande{git checkout merge/rebase}
\commande{git rebase master}
% \begin{tikzpicture}
% \gitDAG[grow down sep = 1em]{
% A -- B --{C, D, E'}};
% \gitbranch{master}{right=of B}{B}
% \gitHEAD{left=of rebase}{rebase}
% \gitbranch[auto]{merge/automatique}{right=of C}{C}
% \gitbranch[conflit]{merge/conflit}{right=of D}{D}
% \gitbranch[rebase]{merge/rebase}{left=of E'}{E'}
% \end{tikzpicture}
\end{frame}
% \begin{tikzpicture}
% % Commit DAG
% \gitDAG[grow right sep = 2em]{
% A -- B -- {
% C,
% D -- E,
% }
% };
% % Tag reference
% \gittag
% [v0p1] % node name
% {v0.1} % node text
% {above=of A} % node placement
% {A} % target
% % Remote branch
% \gitremotebranch
% [origmaster] % node name
% {origin/master} % node text
% {above=of C} % node placement
% {C} % target
% % Branch
% \gitbranch
% {master} % node name and text
% {above=of E} % node placement
% {E} % target
% % HEAD reference
% \gitHEAD
% {above=of master} % node placement
% {master} % target
% \end{tikzpicture}
% \begin{tikzpicture}
% \gitDAG[grow right sep = 2em]{
% A -- B -- {
% C -- D' -- E',
% {[nodes=unreachable] D -- E },
% }
% };
% % Tag reference
% \gittag
% [v0p1] % node name
% {v0.1} % node text
% {above=of A} % node placement
% {A} % target
% % Remote branch
% \gitremotebranch
% [origmaster] % node name
% {origin/master} % node text
% {above=of C} % node placement
% {C} % target
% % Branch
% \gitbranch
% {master} % node name and text
% {above=of E'} % node placement
% {E'} % target
% % HEAD reference
% \gitHEAD
% {above=of master} % node placement
% {master} % target
% \SAandWT
% \end{tikzpicture}