Skip to content
Snippets Groups Projects
Unverified Commit 025e3a98 authored by Laurent Modolo's avatar Laurent Modolo
Browse files

tp.md: add highlight

parent 781dfd05
No related branches found
No related tags found
No related merge requests found
...@@ -42,11 +42,18 @@ editor = vim ...@@ -42,11 +42,18 @@ editor = vim
[alias] [alias]
co = checkout co = checkout
ci = commit ci = commit
cm = "commit -m"
st = status st = status
lo = log --graph --decorate --date-order --all lo = log --graph --decorate --date-order --all
lg = "log --pretty=format:\"%h - %an : %s\"" lg = "log --pretty=format:\"%h - %an : %s\""
lt = log --graph --oneline --all lt = log --graph --oneline --all
unstage = "reset HEAD" unstage = "reset HEAD"
diffs = "diff --stat"
diffh = "diff --staged"
diffc = "diff --check"
logc = "log -G"
d = difftool
``` ```
You can replace `vim` by any other editor of your choice, like `nano` (easier to learn) or `gedit` (graphical). You can replace `vim` by any other editor of your choice, like `nano` (easier to learn) or `gedit` (graphical).
...@@ -73,6 +80,11 @@ git config --global http.sslVerify false ...@@ -73,6 +80,11 @@ git config --global http.sslVerify false
For this method to work, you need to setup a password in you gitlab profile. For this method to work, you need to setup a password in you gitlab profile.
Go to [https://gitlab.biologie.ens-lyon.fr/profile/password/edit](https://gitlab.biologie.ens-lyon.fr/profile/password/edit) and set your password. Go to [https://gitlab.biologie.ens-lyon.fr/profile/password/edit](https://gitlab.biologie.ens-lyon.fr/profile/password/edit) and set your password.
Don't forget to disable this option with the following command at the end of the tp
```sh
git config --global http.sslVerify true
```
### `~/.ssh/config` file method (for your personal computers) ### `~/.ssh/config` file method (for your personal computers)
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:
...@@ -105,7 +117,7 @@ To test your connection run: ...@@ -105,7 +117,7 @@ To test your connection run:
ssh -Tv gitlab_lbmc ssh -Tv 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. *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.*
# Part 1: Git alone # Part 1: Git alone
...@@ -131,8 +143,9 @@ git init ...@@ -131,8 +143,9 @@ git init
ls -la ls -la
``` ```
The `git init` command create a 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.
*You should not temper with the content of the `.git` folder.*
Everything in the `.git` folder belongs to Git the rest of the `alpha` folder belongs 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. When you issue `git` command the content of the `.git` folder is accessed or modified by git.
...@@ -157,7 +170,7 @@ echo 'a' > data/letter.txt ...@@ -157,7 +170,7 @@ echo 'a' > data/letter.txt
git st git st
``` ```
Git doesn’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 `letter.txt` git is aware of a change in the repository. With the creation of `letter.txt` git is aware of a change in the repository.
There are *untracked files*. There are *untracked files*.
...@@ -192,7 +205,7 @@ printf "1" > data/number.txt ...@@ -192,7 +205,7 @@ printf "1" > data/number.txt
We changed the state of `data/number.txt`, but those changes are not staged to be committed. 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. 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). > This *somewhere* is called the *staging area* (where you stage changes).
```sh ```sh
git add data/number.txt git add data/number.txt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment