From 66d1b67b0bc81a0cb42237dfeb5ada3eb4f3cd8d Mon Sep 17 00:00:00 2001 From: riehm1u <clement.riehm3@etu.univ-lorraine.fr> Date: Thu, 10 Feb 2022 09:59:36 +0100 Subject: [PATCH] Ajout de la partie Git --- rendu.tex | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/rendu.tex b/rendu.tex index 220eeee..d962993 100644 --- a/rendu.tex +++ b/rendu.tex @@ -109,6 +109,72 @@ Ajouter \verb|$(vagrant_prompt_info)| au PROMPT dans le themes \subsection*{\#8} \subsection*{\#9} \subsection*{\#10} -\section{Efficacité de l'environnement de travail} +\section{Git} \subsection*{\#1} +\begin{lstlisting}[language=bash] +~/git/vagrantssh $ git init +git status +vagrant up +vagrant halt +git status +\end{lstlisting} +Un dossier .vagrant est créé. L’ajouter dans le fichier gitignore pour l’ignorer. +\begin{lstlisting}[language=bash] +echo .vagrant/ >> .gitignore +git add README.md Vagrantfile srv/ +git commit -m "Ajout initial" +git log +git show cdc5df9f5ec0abe55cc6d825c5c6008560199688 +\end{lstlisting} +\subsection*{\#2.1} +\begin{lstlisting}[language=bash] +git checkout -b new-branche-2000 +nvim Vagrantfile +git add -p +\end{lstlisting} +Les modification ne sont pas dans le working directory. +\subsection*{\#2.2} +\begin{lstlisting}[language=bash] +git checkout master +git merge new-branche-2000 +git log +git show 8fa8008b2c7eeb6e55115f019b6e7ca3e439a4dd +\end{lstlisting} +Spécificité : Le HEAD -> master +\begin{lstlisting}[language=bash] +commit 8fa8008b2c7eeb6e55115f019b6e7ca3e439a4dd (HEAD -> master, new-branche-2000) +\end{lstlisting} +\begin{lstlisting}[language=bash] +git branch +* master + new-branche-2000 +\end{lstlisting} +La branche existe toujours. On peut supprimer la branche. +\subsection*{\#3} +\begin{lstlisting}[language=bash] +git checkout master +git merge new-branche-2000 +git log +git show 8fa8008b2c7eeb6e55115f019b6e7ca3e439a4dd +\end{lstlisting} + +\subsection*{\#4} +\begin{lstlisting}[language=bash] +git checkout -b forward-new-port +\end{lstlisting} +\begin{lstlisting}[language=bash] +nvim Vagrantfile +git add Vagrantfile +git commit -m "Forward port 80" +\end{lstlisting} +\begin{lstlisting}[language=bash] +git checkout master +nvim Vagrantfile +git add Vagrantfile +git commit -m "Forward port 80" +\end{lstlisting} +\begin{lstlisting}[language=bash] +git merge forward-new-port +\end{lstlisting} +Git demande de corriger le conflit. \end{document} -- GitLab