Commit 613c586f authored by Grégory Mounié's avatar Grégory Mounié
Browse files

qq typo

parent 7a1c9ce0
......@@ -12,41 +12,7 @@
#+exclude_tags: noexport
#+creator: Emacs 26.3 (Org mode 9.2.3)
* Introduction to Git
The best book on Git, for freely available: https://git-scm.com/book/en/v2
This page contains few exercices to:
- understand why Version Control Software are so important in modern
computer science
- understand the basics of Git
** A small Git presentation [Matthieu Moy]
- 4 per page :: http://systemes.pages.ensimag.fr/www-unix/avance/seance1-git/Slides/git-handout.pdf
- beamer :: http://systemes.pages.ensimag.fr/www-unix/avance/seance1-git/Slides/git-slides.pdf
** Git and gitlab basics
*** Exercice
(remplacer http://gitlab.ensimag.fr par http://gricad-gitlab.imag.fr )
- http://systemes.pages.ensimag.fr/www-unix/avance/seance1-git/seance-machine-git.pdf
- http://systemes.pages.ensimag.fr/www-unix/avance/seance1-git/sandbox.tar.gz
# ** Practical 2: standalone git
** Git: branches
*** Explanations
http://recherche.noiraudes.net/resources/git/Slides/git-workflow-slides.pdf
*** Practical
- TP :: http://recherche.noiraudes.net/resources/git/Slides/git-workflow-slides.pdf
** Practical 4: Git: under the hood
** Git tools
http://recherche.noiraudes.net/resources/git/Slides/git-tools-slides.pdf
** Git configuration
http://recherche.noiraudes.net/resources/git/Slides/configuring-git-slides.pdf
* Introduction à Git
* M1 Info: Introduction à Git
Le meilleur livre sur Git librement disponible
https://git-scm.com/book/en/v2
......@@ -93,3 +59,41 @@
** Git configuration (en anglais)
http://recherche.noiraudes.net/resources/git/Slides/configuring-git-slides.pdf
* M1 MOSIG: Introduction to Git
The best book on Git, freely available: https://git-scm.com/book/en/v2
This page contains few exercices to:
- understand why Version Control Software are so important in modern
computer science
- understand the basics of Git
** A small Git presentation [Matthieu Moy]
- 4 per page :: http://systemes.pages.ensimag.fr/www-unix/avance/seance1-git/Slides/git-handout.pdf
- beamer :: http://systemes.pages.ensimag.fr/www-unix/avance/seance1-git/Slides/git-slides.pdf
** Git and gitlab basics
*** Practical
(Please remplace http://gitlab.ensimag.fr by http://gricad-gitlab.imag.fr if relevant)
[[./git-computerlab.pdf]]
- http://systemes.pages.ensimag.fr/www-unix/avance/seance1-git/sandbox.tar.gz
# ** Practical 2: standalone git
** Git: branches
*** Explanations
http://recherche.noiraudes.net/resources/git/Slides/git-workflow-slides.pdf
*** Practical in French
http://systemes.pages.ensimag.fr/www-unix/avance/seance1-git-bonus/tp1-flow.pdf
** Git: under the hood
*** Explanation
- http://recherche.noiraudes.net/resources/git/Slides/understanding-git-slides.pdf
*** Practical in French
http://recherche.noiraudes.net/resources/git/TP/tp1-modele-git.pdf
** Git tools
http://recherche.noiraudes.net/resources/git/Slides/git-tools-slides.pdf
** Git configuration
http://recherche.noiraudes.net/resources/git/Slides/configuring-git-slides.pdf
......@@ -56,8 +56,8 @@ An extended self-content french version of this document is available here~:\\
Git is a Version Control Sytem, that is a software designed to manage
the changes to textual documents like the source code of programs.
In the english version of this document, we will often refer to
chapters of the web version of {\em Pro Git Book}
In the English version of this document, we will often refer
some chapters of the web version of {\em Pro Git Book}
at \url{https://git-scm.com/book/en/v2}. This book is freely available in
electronic form (Creative Common NC SA 3.0).
......@@ -71,8 +71,8 @@ and
but Git is the most commonly used, now.
For the following of sections of this practical, we will used a {\em
Gitlab server}. Gitlab has similar functionalities to Github, but is
For the following of sections of this practical, we will use a {\em
Gitlab server}. Gitlab has similar functionalities to GitHub, but is
a free software, and thus many institutions deploy it. If you have a
computer account at Ensimag, you will use
\url{https://gitlab.ensimag.fr}. If you have a computer account at
......@@ -88,7 +88,7 @@ open an account, and use \url{https://gitlab.com}.
\item[Git experts] group yourself in small teams and do alone some
others practical exercises of the web page of this lecture.
\end{description}
\subsection{Organisation}
\subsection{Team organization}
A team will use two Linux PC close to each other (using your own
laptop is perfectly fine). The gitlab server is freely accessible at
......@@ -135,7 +135,7 @@ of \textit{Bob}\\
Gitlab may used the \texttt{https} protocol, or the \texttt{ssh}
protocol.
Using the \texttt{ssh} protocol, you will avoid to type your password
Using the \texttt{ssh} protocol, you will avoid typing your password
at every Git transfer.
You need first to create your own public-private pair of ssh keys.
......@@ -148,7 +148,7 @@ Read now the chapter \url{https://git-scm.com/book/en/v2/Git-on-the-Server-Gener
practice is to create a different key pair per computer, or computer
account.
Thus now, you should have two files \texttt{id\_rsa.pub} (public
Thus, now, you should have two files \texttt{id\_rsa.pub} (public
part) and \texttt{id\_rsa} (private part) in your directory
\texttt{\textasciitilde/.ssh}.
......@@ -262,7 +262,7 @@ bob@laptop2$ firefox gitlab.ensimag.fr
\subsubsection{Repository creation}
Using the menu/button « + », Alice creates an empty projet (\emph{New project}). the project name is \texttt{project1} under the group \verb!alice_bob!.
Using the menu/button « + », Alice creates an empty project (\emph{New project}). The project name is \texttt{project1}, under the group \verb!alice_bob!.
Now, Alice and Bob will work directly in their HOME.
......@@ -279,7 +279,7 @@ Git has three main states that your files can reside in: committed, modified, an
\begin{figure}[H]
\centering
\input{git-sequence.tikz}
\caption{Working dir, staging area (index) and reposotory}
\caption{Working directory, staging area (index) and repository}
\label{fig:git}
\end{figure}
......@@ -357,11 +357,11 @@ add their name at the top and save the file.
\subsection{Commit creation}
The command:
\begin{minted}{bash}
git status # comparaison of working directory and history
\end{minted}
produce~:
should display:
\begin{verbatim}
On branch master
Changes not staged for commit:
......@@ -405,7 +405,7 @@ Now, both, {\em Alice} and {\em Bob} create a new commit~:
git commit -a # register all modifications of the local repository
\end{minted}
The editor start. They have to write a log message. A good log message
The editor starts. They have to write a log message. A good log message
start with a title line, then a blank line, than a short text. The log
message should explain the reason of the modification (Why).
......@@ -452,11 +452,11 @@ or with
git log # textual history.
\end{minted}
Second, {\em Alice} attempts to publish her modifications~:
Second, {\em Alice} attempts to publish her modification:
\begin{minted}{console}
alice@laptop1$ git push
\end{minted}
The publication should failed~:
The publication should fail:
\begin{verbatim}
To ssh://git@gitlab.ensimag.fr/alice_bob/project1.git
! [rejected] master -> master (non-fast forward)
......@@ -470,12 +470,12 @@ Merge the remote changes (e.g. 'git pull') before pushing again. See the
{\em Alice} has first to merge {\em Bob} modifications already published.
{\em Alice} do the merge~:
{\em Alice} do the merging of the version:
\begin{minted}{console}
alice@laptop1$ git pull
\end{minted}
{\em Alice} and {\em Bob} have change the same lines, thus the
{\em Alice} and {\em Bob} have changed the same lines, thus the
automatic merge should fail.
\begin{verbatim}
......@@ -484,15 +484,15 @@ CONFLICT (content): Merge conflict in sandbox/hello.c
Automatic merge failed; fix conflicts and then commit the result.
\end{verbatim}
La bonne nouvelle, c'est que les modifications faites par \textit{Alice} et Bob
sur des endroits différents du fichier ont été fusionnées. Quand une
équipe est bien organisée et évite de modifier les mêmes endroits en
même temps, ce cas est le plus courant~: les développeurs font les
modifications, et le gestionnaire de versions fait les fusions
automatiquement.
The good news: the modifications at different lines are already merged.
{\em Alice} has to set \texttt{hello.c} to the correct version by
% La bonne nouvelle, c'est que les modifications faites par \textit{Alice} et Bob
% sur des endroits différents du fichier ont été fusionnées. Quand une
% équipe est bien organisée et évite de modifier les mêmes endroits en
% même temps, ce cas est le plus courant~: les développeurs font les
% modifications, et le gestionnaire de versions fait les fusions
% automatiquement.
The bad news: {\em Alice} has to set \texttt{hello.c} to the correct version by
hand. Hopefully, problematic lines are well indicated in the file.
\begin{minted}{diff}
<<<<<<< HEAD
......@@ -507,12 +507,11 @@ hand. Hopefully, problematic lines are well indicated in the file.
/* Auteurs : Alice et Bob */
\end{verbatim}
%Si {\em Alice} fait à nouveau
Then
\begin{minted}{console}
alice@laptop1$ git status
\end{minted}
should display~:
should display:
\begin{verbatim}
On branch master
Your branch and 'origin/master' have diverged,
......@@ -526,10 +525,9 @@ Unmerged paths:
no changes added to commit (use "git add" and/or "git commit -a")
\end{verbatim}
To be sure of the results, {\em Alice} check the differences:
To be sure of the results, {\em Alice} checks the differences:
\begin{minted}{bash}
git diff # git diff sans argument, alors qu'on avait
# l'habitude d'appeler 'git diff HEAD'
git diff # and not 'git diff HEAD'
\end{minted}
The result looks like:
\begin{verbatim}
......@@ -562,28 +560,24 @@ Changes to be committed:
\end{verbatim}
Then, {\em Alice} finishes to build the merge commit:
Then, {\em Alice} finishes building the commit of the merging:
\begin{minted}{bash}
git commit
\end{minted}
The default message is sufficient.
The default message is sufficient. {\em Alice} \/saves it and quits the editor.
Looking at the details:
\begin{minted}{bash}
gitk
\end{minted}
{\em Alice} logs show 3 commits: the two modifications and the merge.
La fusion étant faite, {\em Alice} peut mettre à disposition son travail
(le premier commit, manuel, et le commit de fusion) avec~:
{\em Alice}'s logs show 3 commits: the two modifications and the merge.
{\em Alice} publishes her repository state:
\begin{minted}{console}
alice@laptop1$ git push
\end{minted}
and {\em Bob} get it without a glinch:
and {\em Bob} get it without a glitch:
\begin{minted}{console}
bob@laptop2$ git pull
\end{minted}
......@@ -600,10 +594,6 @@ git push # do nothing: already up-to-date
\subsection{Add new files}
À présent, {\em Alice} crée un nouveau fichier, \texttt{toto.c},
avec un contenu quelconque.
{\em Alice} create a new file \texttt{toto.c} and do:
\begin{minted}{console}
alice@laptop1$ git status
......@@ -665,7 +655,7 @@ Fast forward
\subsection{Fichiers ignorés par Git}
\subsection{Ignoring some files in Git}
{\em Bob} creates a new file \texttt{temp-file.txt}.
......
Supports Markdown
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