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

typo, cleaning

parent ed8beae3
......@@ -53,10 +53,10 @@ An extended self-content french version of this document is available here~:\\
\section{Git and Version Control System}
Git is a Version Control Sytem, that is a software designed to manage
Git is a Version Control System, 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
In the English version of this document, we often refer to
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).
......@@ -67,14 +67,14 @@ and
\href{https://git-scm.com/book/en/v2/Getting-Started-What-is-Git%3F}{Chapter 1.3}
\href{https://en.wikipedia.org/wiki/Comparison_of_version-control_software}{Numerous VCS exists},
Numerous VCS, \href{https://en.wikipedia.org/wiki/Comparison_of_version-control_software}{listed in Wikipedia}, exist,
but Git is the most commonly used, now.
For the following of sections of this practical, we will use a {\em
Gitlab server}. Gitlab has similar functionalities to GitHub, but is
For the following of sections of this document, we use a {\em
Gitlab server}. Gitlab has similar functionalities to GitHub. But, it is
a free software, and thus many institutions deploy it. If you have a
computer account at Ensimag, you will use
computer account at Ensimag, you use
\url{https://gitlab.ensimag.fr}. If you have a computer account at
UGA, you may also use
\url{https://gricad-gitlab.univ-grenoble-alpes.fr}. Finally, you may
......@@ -96,7 +96,7 @@ any time from any places. The git repository of the team is assumed
to be in \texttt{gitlab.ensimag.fr}.
Let us assume that the team is composed of two people, \texttt{Alive}
Let us assume that the team is composed of two people, \textit{Alice}
on \texttt{laptop1} and \textit{Bob} on \texttt{laptop2}. Explanations
may be extended to any number of team members.
......@@ -135,14 +135,14 @@ of \textit{Bob}\\
Gitlab may used the \texttt{https} protocol, or the \texttt{ssh}
protocol.
Using the \texttt{ssh} protocol, you will avoid typing your password
Using the \texttt{ssh} protocol, you avoid typing your password
at every Git transfer.
You need first to create your own public-private pair of ssh keys.
Read now the chapter \url{https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key}
Read now \href{https://git-scm.com/book/en/v2/Git-on-the-Server-Generating-Your-SSH-Public-Key}{the Chapter 4.3}
\begin{itemize}
\item If you do not have it yet, create a public-private key pair with
\item If you do not have one yet, create a public-private key pair with
\texttt{ssh-keygen}. Choose a good passphrase. A sentence, or few
words, that you will never forget, are perfectly fine. The good
practice is to create a different key pair per computer, or computer
......@@ -173,7 +173,7 @@ Enter passphrase for /home/petrot/.ssh/id_rsa:
\item Copy the public key, the content of \texttt{id\_rsa.pub}, in your
account on \url{https://gitlab.ensimag.fr}. In your \emph{User
Settings} (Menu top right, third entry) you will find a section
Settings} (Menu top right, third entry) you find a section
\emph{SSH Keys} (Menu on the left). Copy-paste the public key in the
form. Choose a name and click on \texttt{Add key}.
\end{itemize}
......@@ -184,14 +184,14 @@ On your own computer, to use Git, you will have to install it
first. Under Ubuntu or Debian « \texttt{apt-get install git gitk} » ou
« \texttt{apt-get install git-core gitk} ».
Details on the Git configuration are presented in Chapter 8.1
Details on the Git configuration are presented in
\href{https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration}{Chapter 8.1}.
Create or edit the \texttt{\textasciitilde/.gitconfig} file:
\begin{minted}{bash}
emacs ~/.gitconfig # or your favorite editor
emacs ~/.gitconfig # or use your favorite editor
\end{minted}
Add at least \texttt{.gitconfig} the following content:
Add, in \texttt{.gitconfig}, at least, the following content:
\begin{minted}{ini}
[core]
......@@ -216,14 +216,13 @@ Add at least \texttt{.gitconfig} the following content:
pager = true
\end{minted}
Beware of modern editor already running. If the editor command finish
early, Git will return
Beware of "modern" editor already running when committing. If the editor command finishes early, Git will display
\begin{verbatim}
Aborting commit due to empty commit message.
\end{verbatim}
and nothing will be registered.
The section \texttt{[push]} is there only to homogenize the behavior of old Git version.
The section \texttt{[push]} is only there to homogenize the behavior of old Git version.
\section{Starting a new project}
......@@ -233,7 +232,7 @@ should do it.
\subsection{Shared repository creation in Gitlab}
\label{sec=creation-depot-partagee}
\textit{Alice} will connect to her account on \texttt{gitlab.ensimag.fr}:
\textit{Alice} connects to her account on \texttt{gitlab.ensimag.fr}:
\begin{minted}{console}
alice@laptop1$ firefox gitlab.ensimag.fr
......@@ -251,7 +250,7 @@ the default in Gitlab.
Using the « Groups » button, \textit{Alice} add \textit{Bob} as team
member: left menu \emph{Members}, then add Bob in \emph{Add new
member}. \textit{Bob} will have the same role as \textit{Alice}:
member}. \textit{Bob} has the same role as \textit{Alice}:
\emph{Owner}.
Note: \textit{Bob} may have to connect at least once to Gitlab before
......@@ -264,7 +263,7 @@ bob@laptop2$ firefox gitlab.ensimag.fr
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.
Now, Alice and Bob work directly in their HOME.
The figure \ref{fig:git} presents the typical exchanges and states of the files.
\footnote{\url{https://git-scm.com/book/en/v2/Getting-Started-Git-Basics}\\
......@@ -290,7 +289,7 @@ Git has three main states that your files can reside in: committed, modified, an
As the project is empty, there is no file in it. \textit{Alice} adds
the first files as the first step.
\textit{Alice} clone the remote repository to create her working
\textit{Alice} clones the remote repository to create her working
directory \verb|~/project1|:
{\small
......@@ -304,7 +303,7 @@ subdirectory \texttt{.git/} with the Git meta-data and file history.
Alice downloads the directory \texttt{sandbox/} (at
\url{https://ensiwiki.ensimag.fr/index.php/Fichier:Sandbox.tar.gz}),
extract it and add it to the Git history.
extracts it and adds it to the Git history.
\begin{minted}{console}
alice@laptop1$ wget https://ensiwiki.ensimag.fr/images/8/86/Sandbox.tar.gz
......@@ -376,7 +375,7 @@ Changes not staged for commit:
registered in the local history.
{\em Alice} and {\em Bob} look at the details of the differences
between current state of the file and its last state in history:
between the current state of the file and its last state in history:
\begin{minted}{bash}
git diff HEAD
\end{minted}
......@@ -398,7 +397,7 @@ index a47665a..7f67d33 100644
\end{verbatim}
Lines starting with '-' are removed from previous commit.
Lines starting with '+' are added to previous commit.
Lines starting with '+' are added from previous commit.
Now, both, {\em Alice} and {\em Bob} create a new commit~:
\begin{minted}{bash}
......@@ -406,7 +405,7 @@ git commit -a # register all modifications of the local repository
\end{minted}
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
start with a title line, then a blank line, then a short text. The log
message should explain the reason of the modification (Why).
After saving the message and quitting the editor, they read in their terminal:
......@@ -442,12 +441,12 @@ First, \textbf{ONLY} {\em Bob} publishes its commit~:
bob@laptop2$ git push # send the Bob commit to shared repository
\end{minted}
{\em Alice} and {\em Bob} should follow change in the local history:
{\em Alice} and {\em Bob} should follow changes in the local history with:
%Pour voir où on en est, les deux équipes peuvent lancer la commande~:
\begin{minted}{bash}
gitk # graphical history
\end{minted}
or with
or with:
\begin{minted}{bash}
git log # textual history.
\end{minted}
......@@ -493,7 +492,7 @@ The good news: the modifications at different lines are already merged.
% 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.
hand. Hopefully, problematic lines are clearly indicated in the file.
\begin{minted}{diff}
<<<<<<< HEAD
/* Auteurs : Alice et ... */
......@@ -598,7 +597,7 @@ git push # do nothing: already up-to-date
\begin{minted}{console}
alice@laptop1$ git status
\end{minted}
should display:
that should display:
\begin{verbatim}
On branch master
Untracked files:
......@@ -608,7 +607,7 @@ Untracked files:
nothing added to commit but untracked files present (use "git add" to track)
\end{verbatim}
To put it in the next commit, {\em Alice} has to mark him for tracking
To put it in the next commit, {\em Alice} has to mark it for tracking
first with \texttt{git add toto.c}:
\begin{minted}{console}
......@@ -625,8 +624,7 @@ Changes to be committed:
\end{verbatim}
{\em Alice} create the commit in one line, providing the message:
{\em Alice} creates the commit in one line, providing directly the message:
\begin{minted}{bash}
alice@laptop1$ git commit -m "ajout de toto.c"
\end{minted}
......@@ -641,7 +639,7 @@ should display:
\begin{minted}{console}
alice@laptop1$ git push
\end{minted}
{\em Bob} get the file with the following command:
{\em Bob} gets the file with the following command:
\begin{minted}{console}
bob@laptop2$ git pull
\end{minted}
......@@ -676,7 +674,7 @@ nothing added to commit but untracked files present (use "git add" to track)
If {\em Bob} do not want to track the file in the repository, he
should register in the repository that this file should be ignored.
He will add the file name into a file \texttt{.gitignore} in the same
He adds the file name into a file \texttt{.gitignore} in the same
directory.
{\em Bob} opens the file:
......
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