From e1f2321c5f42c85e9b67e516803f2cfba9c91f76 Mon Sep 17 00:00:00 2001
From: Laurent Heirendt <laurent.heirendt@uni.lu>
Date: Mon, 16 Jan 2017 07:57:00 +0100
Subject: [PATCH] Changes to slides

---
 essential_commands.md | 116 ++++++++++++++++++++----------------------
 good_practices.md     |  18 +++++++
 installation.md       |   2 +
 list.json             |   6 +++
 overview.md           |   7 +--
 thanks.md             |   4 +-
 the_terminal.md       |  27 ++++++++++
 7 files changed, 114 insertions(+), 66 deletions(-)
 create mode 100644 good_practices.md

diff --git a/essential_commands.md b/essential_commands.md
index 7beb05c5..f1e31177 100644
--- a/essential_commands.md
+++ b/essential_commands.md
@@ -7,7 +7,7 @@
 `pull, status, add, commit, push`
 
 <br>
-or in other words (more technically)
+or in other words (remember these!)
 ```shell
 $ git pull
 $ git status
@@ -36,100 +36,94 @@ $ git status
 ```
 
 
-## Creat
+## Modify a file
 
-Créer l'espace de travail
+Modify and rename `addTwoNumbers.m` in the folder `firstCommit`
 
-```shell
-$ cd
-$ mkdir workspace
-$ cd workspace
-```
-
-Puis le dossier du nouveau projet
+<br>
+Open the file `addTwoNumbers.m` in the folder `firstCommit` using the `Atom` editor (or any other editor).
 
-```shell
-$ mkdir listes
-$ cd listes
-$ git init
+<br>
+Then, uncomment the line
+```Matlab
+% c = a + b
 ```
 
+<br>
+Save and rename the file by adding your name
+```sh
+mv firstCommit/addTwoNumbers.m firstCommit/addTwoNumbers_myName.m
+```
 
-## Nouveau fichier
 
-Créer le fichier `courses.txt`
+## Add your file to the stage
 
-<div class="fragment">
-```shell
+First, check the repository status
+```sh
 $ git status
+# uncommitted changes (displayed in red)
 ```
 
 <div class="fragment">
-```shell
-$ git add courses.txt
-$ git status
+<br>
+Now, add the file (bring it on stage)
+```sh
+$ git add firstCommit/addTwoNumbers_myName.m
+# returns the same as before, generally in green (means staged)
 ```
 
 <div class="fragment">
-```shell
-$ git commit -m "Creation de la liste de courses"
-$ git status
+<br>
+**ADVANCED**: see your changes in the terminal
+```sh
+$ git diff
 ```
-
-note:
-    Pas besoin de serveur, pas besoin de connexion Internet
+exit with `:q`
 
 
-## Modification de fichier
+## Add a commit message
 
-Modifier le fichier `courses.txt`
-
-<div class="fragment">
 ```shell
+$ git commit -m "Uncommented line for adding 2 numbers"
 $ git status
 ```
 
-<div class="fragment">
-```shell
-$ git diff courses.txt
+<br>
+You can pull, even at this stage, new possible changes
+```sh
+$ git pull
 ```
 
-<div class="fragment">
-```shell
-$ git add courses.txt
-$ git status
-```
 
-<div class="fragment">
-```shell
-$ git commit -m "Ajout du beurre"
-$ git status
+## Push your file to the folder
+
+```sh
+$ git push
 ```
 
 <div class="fragment">
-```shell
+<br>
+**ADVANCED**: see the log of all the commits (and your last one) in the terminal
+```sh
 $ git log
 ```
+exit with `:q`
 
 
-## Que s'est-il passé ?
-
-
-## Espace de travail
-
-_working directory_
-
-```shell
-$ git status
-  # Changes not staged for commit:
-```
-
-
-## Zone de transit
+## Do it yourself:
 
-_index_ ou _staging area_
+* Modify and rename `secondCommit/multiplyTwoNumbers.m`
+* Push the file `secondCommit/multiplyTwoNumbers_myName.m`
 
-```shell
+<div class="fragment">
+<br>
+Commands:
+```sh
+$ git pull
+$ git diff # optional
+$ git add secondCommit/multiplyTwoNumbers_myName.m
+$ git commit -m "Uncommented line for multiplying 2 numbers"
 $ git status
-  # Changes to be commited:
+$ git push
+$ git log # optional
 ```
diff --git a/good_practices.md b/good_practices.md
new file mode 100644
index 00000000..a30a4b2a
--- /dev/null
+++ b/good_practices.md
@@ -0,0 +1,18 @@
+## Good practices
+
+1. `clone` a repository, do not download the `.zip` file.
+2. `pull` before `push`
+3. Work on your own branch (in your own fork)
+4. Do not `push` to `master`
+5. Do not `push` to `develop`
+6. Stage only 1 file at once using
+```sh
+$ git add myFile.txt
+```
+7. Commit only a few files at once
+8. Submit a PR instead of pushing directly
+9. Always sync your fork before starting to work
+10. `Push` often - avoid conflicts
+
+<br><br>
+**A `push` a day keeps the conflict away**
diff --git a/installation.md b/installation.md
index 3eba835d..89e984ae 100644
--- a/installation.md
+++ b/installation.md
@@ -71,6 +71,7 @@ Simply `clone` the repository (i.e., retrieve a copy)
 $ git clone https://github.com/opencobra/cobratoolbox.git cobratoolbox
 ```
 
+<br>
 Any other rudimentary method such as
 
 *'I simply download the `.zip` un unzip it - works like a charm!'*
@@ -85,6 +86,7 @@ You can clone any other repository with:
 $ git clone https://github.com/userName/myRepo.git myRepo
 ```
 
+<div class="fragment">
 <br>
 Clone the training repository with:
 ```sh
diff --git a/list.json b/list.json
index 00710843..aac60791 100644
--- a/list.json
+++ b/list.json
@@ -53,6 +53,12 @@
           "data-background": "../img/whiteBG.jpg"
         }
     },
+    {
+        "filename": "good_practices.md",
+        "attr": {
+          "data-background": "../img/whiteBG.jpg"
+        }
+    },
     {
         "filename": "thanks.md",
         "attr": {
diff --git a/overview.md b/overview.md
index 905af770..f732a5b6 100644
--- a/overview.md
+++ b/overview.md
@@ -5,8 +5,9 @@
 2. GitHub and GitLab <!--(5min)//-->
 3. Installation of `git`
 4. The 5 essential commands <!--(10 min)//-->
-        - `clone/pull` / `status` / `add` / `commit` / `push`
+    * `clone/pull` / `status` / `add` / `commit` / `push`
 5. Branches <!--(10 min)//-->
 6. Forks <!--(10 min)//-->
-7. Practical session  <!--(40 min)//-->
-8. Evaluation <!--(10 min)//-->
+7. Good practices
+8. Practical session  <!--(40 min)//-->
+9. Evaluation <!--(10 min)//-->
diff --git a/thanks.md b/thanks.md
index d360c383..e234bf21 100644
--- a/thanks.md
+++ b/thanks.md
@@ -1,9 +1,9 @@
-# References
+## References
 
 [1]: **Git** Book: https://git-scm.com/book/en/v2
 
 
-# Acknowledgement
+## Acknowledgement
 
 Laurent Heirendt
 
diff --git a/the_terminal.md b/the_terminal.md
index a53ce9b1..a0bdfada 100644
--- a/the_terminal.md
+++ b/the_terminal.md
@@ -4,32 +4,59 @@ Starting the terminal presents itself with a line where you can enter a command:
 ```sh
 cesar@myComputer>
 ```
+
+<div class="fragment">
+<br>
 Often written, for covenience, as:
 ```sh
 $
 ```
+
+<br>
 When you open your terminal (git shell) and unless otherwise configured, you are located
 in your home directory, denoted as `~/`.
 
 
 ## Essential Linux commands
 
+<div class="fragment">
 List the contents of a directory
 ```sh
 $ ls
 ```
 
+<div class="fragment">
+<br>
 Change the directory to a specific folder
 ```sh
 $ cd myDirectory
 ```
 
+<div class="fragment">
+<br>
 Change the directory 1 level and 2 levels up
 ```sh
 $ cd ..
 $ cd ../..
 ```
+
+<div class="fragment">
+<br>
 Create a directory
 ```sh
 $ mkdir myNewDirectory
 ```
+
+<div class="fragment">
+<br>
+Move a file or a directory
+```sh
+$ mv myFile.m myDirectory/.
+```
+
+<div class="fragment">
+<br>
+Rename a file or a directory
+```sh
+$ mv myFile.m myNewFile.m
+```
-- 
GitLab