Unverified Commit 2e37f270 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

fix typo in tp.md

parent 5f409cca
......@@ -21,8 +21,8 @@ latex_engine: xelatex
We are going to write some basic configuration files to be able to the [gitlab server of the LBMC](http://gitlab.biologie.ens-lyon.fr).
If you are not using your own laptop, remember to delete your `~/.ssh` folder at the end of the TP.
Otherwise, somebody else could use your ssh key if you don't protect them with a password.
But don't stress to much about it, you can always remove the key later from your [gitlab configuration](http://gitlab.biologie.ens-lyon.fr/profile/keys).
Otherwise, somebody else could use your ssh key if you dont protect them with a password.
But dont stress too much about it, you can always remove the key later from your [gitlab configuration](http://gitlab.biologie.ens-lyon.fr/profile/keys).
Throughout this practical, every string between chevrons `<like this one>` must be replaced with the adequate value.
......@@ -31,7 +31,7 @@ Throughout this practical, every string between chevrons `<like this one>` must
Git can be configured with the `git config` command or directly by editing the `~/.gitconfig` file. Here is a config example to start:
```sh
# This is Git's per-user configuration file.
# This is Git per-user configuration file.
[user]
name = <your name>
email = <your mail>
......@@ -52,13 +52,13 @@ unstage = "reset HEAD"
You can replace `vim` by any other editor of your choice, like `nano` (easier to learn) or `gedit` (graphical).
The **alias** section of the configuration is for shortcuts of git commands.
`git checkout` is now equivalent to `git co` to minimize the number of key pressed.
`git checkout` is now equivalent to `git co` to minimize the number of keys pressed.
## Gitlab connection
There are many ways to connect to a gitlab server.
Git relies on other system protocols to handle authentication and rights.
Here we are going to use two different method depending if you are using your laptop or a PSMN computer.
Here we are going to use two different methods depending on if you are using your laptop or a PSMN computer.
### https method (for the PSMN computers)
......@@ -82,7 +82,7 @@ ssh-keygen -t rsa -C "your.email@ens-lyon.fr" -b 4096 -f ~/.ssh/id_rsa_gitlab_lb
```
When you are on a UNIX system and when you have the right to remove the writing permission to your `~/.ssh/config` for the group and the others, you can use this method.
Otherwise, `ssh` won't let you use this configuration file for security reasons.
Otherwise, `ssh` wont let you use this configuration file for security reasons.
You need to add the following lines to the file `~/.ssh/config` to use it automatically for connection to `gitlab_lbmc`.
......@@ -131,9 +131,9 @@ git init
ls -la
```
The `git init` command create an hidden `.git` folder at the root of your project.
The `git init` command create a hidden `.git` folder at the root of your project.
You should not temper with the content of the `.git` folder.
Everythings in the `.git` folder belong to Git the rest of the `alpha` folder belong to you.
Everything in the `.git` folder belongs to Git the rest of the `alpha` folder belongs to you.
When you issue `git` command the content of the `.git` folder is accessed or modified by git.
......@@ -157,11 +157,11 @@ echo 'a' > data/letter.txt
git st
```
Git don't track folders, only files. For git folders are just structures to organise files.
Git doesn’t track folders, only files. For git folders are just structures to organise files.
With the creation of `dict.txt` git is aware of a change in the repository.
There are *untracked files*.
To start tracking file we use the command `git add` :
To start tracking files we use the command `git add` :
```sh
git add data/letter.txt
......@@ -179,7 +179,7 @@ git st
There are now changes to be committed, this means that git is now following the state of the `data/letter.txt` file.
The current state of `data/letter.txt` is recorded.
![git add made a copy of the a file creating the corresponding blob](img/staging_1.png){height=150px}
![git add made a copy of the file creating the corresponding blob](img/staging_1.png){height=150px}
```sh
git ls-files --stage
......@@ -189,7 +189,7 @@ git ls-files --stage
printf "1" > data/number.txt
```
We changed the state of `data/number.txt`, but those changes are not staged for commit.
We changed the state of `data/number.txt`, but those changes are not staged to be committed.
The previous states of `data/number.txt` is still recorded *somewhere* even if it differs from its current state.
This *somewhere* is called the staging area (where you stage changes).
......@@ -199,7 +199,7 @@ git add data/number.txt
git ls-files --stage
```
![modifications in the working area don't affect what's stored in Git](img/staging_2.png){height=150px}
![modifications in the working area dont affect whats stored in Git](img/staging_2.png){height=150px}
![The staging area is different from the working directory](img/staging_3.png)
......@@ -228,7 +228,7 @@ git log
git lo
```
You wrote your first commit with an unique identifier:
You wrote your first commit with a unique identifier:
`531019e7119268c4dae5ac44ef5929165794f4b0`
> `git commit`:
......@@ -241,9 +241,9 @@ git ls-tree -r 531019e7119268c4dae5ac44ef5929165794f4b0
git ls-tree -d 531019e7119268c4dae5ac44ef5929165794f4b0
```
The `531019e7119268c4dae5ac44ef5929165794f4b0` point to the tree object with point to the two committed files.
The `531019e7119268c4dae5ac44ef5929165794f4b0` points to the tree object which points to the two committed files.
[The commit a1 record the tree structure and the files corresponding to the staging area](img/commit_a1.png)
![The commit a1 record the tree structure and the files corresponding to the staging area](img/commit_a1.png)
In git, there are 3 areas:
......@@ -253,11 +253,11 @@ In git, there are 3 areas:
![git areas](img/three_git_areas.png)
The repository is a chain of commit beginning with your first commit.
The repository is a chain of commit, beginning with your first commit.
### Navigating a git repository
Let's create a new commit with the changes made to `data/number.txt`:
Lets create a new commit with the changes made to `data/number.txt`:
```sh
echo "2" > data/number.txt
......@@ -287,32 +287,32 @@ The `git checkout` or `git co` command rewrite your whole working area to match
git log
```
The `git log` command don't display your second commit anymore.
The `git log` command doesn’t display your second commit anymore.
Git commits only know of their direct ancestor(s).
The other change is in the first line of the `git log` command:
`(HEAD -> master)` became (HEAD).
This change mean that you are in a *detached HEAD* state , the command `git st` also gives you this information.
This change means that you are in a *detached HEAD* state , the command `git st` also gives you this information.
```sh
git st
```
In git commit are chained one after another starting with the first commit.
Therefore, you can always go back in the commit history.
Therefore, you can always go back to the commit history.
The repository, is not only made of commit but also of labels.
The repository is not only made of commits, but also of labels.
Labels point to a commit and can be the target of the `git co` command.
They are two types of labels:
- branches
- tags
If the first commit is the root of a growing tree of commits, branches are the leafs of the tree.
If the first commit is the root of a growing tree of commits, branches are the leaves of the tree.
They change after each commit from pointing to the ancestor of the new commit, to pointing to the new commit.
The default branch in git is called `master`
Contrary to branches tags are anchored to a fixed commit.
*HEAD*, is a special label that indicate your position in the tree of commit.
*HEAD* is a special label that indicates your position in the tree of commits.
You can add a tag to your first commit with the command `git tag`
......@@ -336,10 +336,10 @@ We are back at the leaf of the git repository.
## Growing the repository tree
We only have one branch, the `master` branch in our repository.
This mean that we only have one timeline in our history.
In git, you can have as many branches as you want, to tests out things for example.
This means that we only have one timeline in our history.
In git, you can have as many branches as you want, to test out things, for example.
The following command create the branch `dev` and move us (*HEAD*) to it.
The following command creates the branch `dev` and move us (*HEAD*) to it.
```sh
git co -b dev
git st
......@@ -347,13 +347,13 @@ git lo
```
```sh
echo '3' > data/number.txt
echo ’3’ > data/number.txt
git add data/number.txt
git commit -m "a3"
git lo
```
If we have two branches `dev` and `master`, it's hard to tell them apart (`master` is shorter).
If we have two branches `dev` and `master`, its hard to tell them apart (`master` is shorter).
```sh
git co master
......@@ -363,15 +363,15 @@ git commit -m "b2"
git lo
```
Congratulation you have a fork in your git repository !
Congratulations, you have a fork in your git repository !
Lets make another one called `dev2` from the branch `master` where `data/letter.txt` contain the letter `c`.
Lets make another one called `dev2` from the branch `master` where `data/letter.txt` contain the letter `c`.
Then create the corresponding commit `c2`
## Merging branches
When you are ready to incorporate your new code in your main branch you need to merge the branch containing the new code into your main branch.
You can merge branch with the command `git merge`.
You can merge branches with the command `git merge`.
This command is going to try to merge the targeted branch into the branch you are on (*HEAD*).
The command `git branch` shows you the available branches and the one you are on.
......@@ -417,12 +417,12 @@ git lo
```
The new commit is a `Merge` commit with the identifiers of its two ancestors.
Here, we didn't have any conflict: in the `dev` branch, we worked on the `data/number.txt` file while in the `master` branch, we worked on the `data/letter.txt` file.
Here, we didnt have any conflict: in the `dev` branch, we worked on the `data/number.txt` file while in the `master` branch, we worked on the `data/letter.txt` file.
Let's complicate things !
Lets complicate things !
Create a new commit `e3` in the `master` branch where the content of `data/letter.txt` is set to `e`.
Then create a new commit in the `dev` branch where the content of `data/letter.txt` is set to `f` and go back the the branch `master`.
Then create a new commit in the `dev` branch where the content of `data/letter.txt` is set to `f` and go back the branch `master`.
```sh
git lt
......@@ -431,7 +431,7 @@ git merge dev
git st
```
The automatic merge fail due to a conflict in `data/letter.txt`.
The automatic merge failed due to a conflict in `data/letter.txt`.
You are now in a merging state.
You must solve the conflict by editing `data/letter.txt`.
......@@ -452,7 +452,7 @@ git st
git lt
```
You now, know how to deal with the different kind of merge
You, now, know how to deal with the different kind of merge
# Part 2: Git remote
......@@ -547,11 +547,11 @@ git status # README.md is in the git repository
We then add a small description.
```sh
echo "small python software to handle dated file names" >> README.md
echo "smalll python software to handle dated file names" >> README.md
git status
git diff README.md
git add README.md
git commit -m "README: small description of the software"
git commit -m "README: smalll description of the software"
```
We made a mistake in the last commit: there is a typo in the commit message and
......@@ -589,7 +589,7 @@ repository :
`git@gitlab.biologie.ens-lyon.fr:<user_name>/git_basis.git`.
with the https protocol we have:
`https://lmodolo@gitlab.biologie.ens-lyon.fr/<user_name>//git_basis.git`
`https://lmodolo@gitlab.biologie.ens-lyon.fr/<user_name>/git_basis.git`
> Note: repositories created on gitlab are _bare_ repository. There is no working
> or stash area on gitlab because nobody works on it.
......@@ -643,12 +643,12 @@ git merge tp1
git push perso
```
You can see the graph of our modifications at the following address [http://gitlab.biologie.ens-lyon.fr/user_name/git_basis/network/master](http://gitlab.biologie.ens-lyon.fr/user_name/git_basis/network/master)
You can see the graph of our modifications at the following address [http://gitlab.biologie.ens-lyon.fr/<user_name>/git_basis/network/master](http://gitlab.biologie.ens-lyon.fr/<user_name>/git_basis/network/master)
# Part 3: Git together
Branch management is at the heart of Git.
These powerful mechanisms will help you to work in collaboration with others.
For the last part of the TP you need to pair with someone else. We will refer to you as developer **W** and the other as developer **C**.
For the last part of the TP you need to pair with someone else. We will refer to you as developer **W** and the other person as developer **C**.
## Developer **W**:
......@@ -672,7 +672,7 @@ git remote -v
git checkout -b tp2
```
The only remote that **C**’s local repository knows of is **W**’s remote.
The only remote that **C**’s local repository knows is **W**’s remote.
**C** adds a dependency section to `README.md`
......@@ -752,7 +752,7 @@ To use the `file_handle.py` script, enter the following command:
file_handle.py -f <INPUT_FILE>
```
if `<INPUT_FILE>` exist and is not dated `file_handle.py` will date it.
if `<INPUT_FILE>` exists and is not dated `file_handle.py` will date it.
Then `file_handle.py` will return the absolute path to the last version of
`<INPUT_FILE>`.
````
......@@ -798,7 +798,7 @@ file_handle.py --help
To use the `file_handle.py` script, enter the following command: ```sh
file_handle.py -f <INPUT_FILE>
```
if `<INPUT_FILE>` exist and is not dated `file_handle.py` will date it. Then `file_handle.py` will return the absolute path to the last version of `<INPUT_FILE>`.
if `<INPUT_FILE>` exists and is not dated `file_handle.py` will date it. Then `file_handle.py` will return the absolute path to the last version of `<INPUT_FILE>`.
>>>>>>> c470f055f499bc13fa64d90f3b5cb38314b34b6e
````
......
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