Unverified Commit acda20d2 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

upgrade tp.md

parent 0a584cf7
......@@ -7,9 +7,9 @@ R -e 'install.packages("rmarkdown", repos = "https://cloud.r-project.org")'
make
```
## [Practial guide](./tp.md)
## Practial guide
The practical guide is decomposed in three sections.
The practical guide is decomposed in three sections, after [configuring your ssh client](./tp.md):
- In the first part [ **Git Alone** ](./tp_1.md#part-1-git-alone), you will learn to use the basic Git command.
- In the second part [ **Git remote** ](./tp_2.md#part-2-git-remote), you will learn to interact with a Git remote repository
......
......@@ -47,7 +47,7 @@ The **alias** section of the configuration is for shortcuts of git commands.
There are many ways to connect to a gitlab server (you are browsing one right now).
The git software relies on other system protocols to handle authentication and rights.
To connect to the gitlab server via ssh, you first need to generate a ssh key:
- To connect to the gitlab server via ssh, you first need to generate a ssh key:
```sh
ssh-keygen -t rsa -C "<your_email>@ens-lyon.fr" -b 4096 -f ~/.ssh/id_rsa_gitlab_lbmc
......@@ -56,7 +56,7 @@ ssh-keygen -t rsa -C "<your_email>@ens-lyon.fr" -b 4096 -f ~/.ssh/id_rsa_gitlab_
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.
You need to add the following lines to the file `~/.ssh/config` to use it automatically for connection to `gitlab_lbmc`.
- You need to add the following lines to the file `~/.ssh/config` to use it automatically for connection to `gitlab_lbmc`.
```sh
Host gitlab_lbmc
......@@ -69,12 +69,12 @@ Host gitlab_lbmc
This configuration provides you with the shortcut `gitlab_lbmc` to connect to the `gitlab.biologie.ens-lyon.fr` server on the port `2222` under the `git` user, without using a password and using the identity key ` ~/.ssh/id_rsa_gitlab_lbmc`.
Finally, go to [http://gitlab.biologie.ens-lyon.fr/profile/keys](http://gitlab.biologie.ens-lyon.fr/profile/keys) and paste the content of the file `~/.ssh/id_rsa_gitlab_lbmc.pub`
- Finally, go to [http://gitlab.biologie.ens-lyon.fr/profile/keys](http://gitlab.biologie.ens-lyon.fr/profile/keys) and paste the content of the file `~/.ssh/id_rsa_gitlab_lbmc.pub`
To test your connection run:
```sh
ssh -Tv gitlab_lbmc
ssh -T gitlab_lbmc
```
**With this second method, you will have to replace every `https://gitlab.biologie.ens-lyon.fr/` url in the sequel with `gitlab_lbmc:`, the shortcut you defined in your `~/.ssh/config` file.**
......
......@@ -10,8 +10,8 @@ In this first part of the TP you will practice different git commands to keep tr
Start by creating a folder `alpha` in which you are going to write your project:
```sh
mkdir alpha
cd alpha
mkdir alpha # folder creation (makedirectory)
cd alpha # move into the folder (changedirectory)
```
Once in the alpha folder, you can initialize a Git repository.
......@@ -19,7 +19,7 @@ A Git repository is a project tracked and indexed by git.
```sh
git init
ls -la
ls -la # list directory
```
> The `git init` command create a hidden `.git` folder at the root of your project.
......@@ -45,7 +45,7 @@ Our first code:
```sh
mkdir data
git st
echo 'a' > data/letter.txt
echo 'a' > data/letter.txt # display the letter "a" (echo) into (>) the file data/letter.txt
git st
```
......@@ -78,7 +78,7 @@ git ls-files --stage
echo "1234" > data/number.txt
git add data/number.txt
git ls-files --stage
printf "1" > data/number.txt
echo "1" > data/number.txt
```
We changed the state of `data/number.txt`, but those changes are not staged to be committed.
......@@ -121,7 +121,7 @@ git lo
```
You wrote your first commit with a unique identifier:
`531019e7119268c4dae5ac44ef5929165794f4b0`
`531019e7119268c4dae5ac44ef5929165794f4b0` (not this exact identifier as you are not me and did not do the commit at the exact same time as me).
> `git commit`:
> - creates a tree graph to represent the content of the version of the project being committed
......
......@@ -135,8 +135,8 @@ repository :
with the https protocol we have:
`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.
> Note: repositories created on gitlab are _bare_ repository. There is no working
> or stash area on gitlab because nobody works on it.
At the end of the page [http://gitlab.biologie.ens-lyon.fr/<user_name>/git_basis](http://gitlab.biologie.ens-lyon.fr/<user_name>/git_basis) you have the following instruction to populate your remote repository
from an existing repository.
......
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