Julien Dehos il y a 8 ans
Parent
commit
f6ca2dbaa8
9 fichiers modifiés avec 204 ajouts et 100 suppressions
  1. 0 24
      concepts_commits.svg
  2. 27 0
      concepts_commits_1.svg
  3. 37 0
      concepts_commits_2.svg
  4. 43 0
      concepts_commits_3.svg
  5. 0 24
      concepts_depots.svg
  6. 1 0
      concepts_depots_git.svg
  7. 1 0
      concepts_depots_svn.svg
  8. 34 40
      dessin.svg
  9. 61 12
      index.md

+ 0 - 24
concepts_commits.svg

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-
-<svg xmlns="http://www.w3.org/2000/svg" width="600" height="300" >
-
-            <circle cx="100" cy="100" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="95" y="105" font-size="18"> 1 </text>
-
-            <circle cx="300" cy="100" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="295" y="105" font-size="18"> 4 </text>
-
-            <circle cx="500" cy="100" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="495" y="105" font-size="18"> 6 </text>
-
-            <defs>
-              <marker id='head' orient="auto" markerWidth='4' markerHeight='8' refX='0.2' refY='3'>
-                <path d='M0,0 V6 L3,3 Z' />
-              </marker>
-            </defs>
-
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,50 C250,20 350,20 450,120' />
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,100 L250,100 ' />
-
-</svg>
-

+ 27 - 0
concepts_commits_1.svg

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="600" height="100" >
+
+<circle cx="50" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="45" y="55" font-size="18"> 1 </text>
+
+<circle cx="150" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="145" y="55" font-size="18"> 2 </text>
+
+<circle cx="250" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="245" y="55" font-size="18"> 3 </text>
+
+<circle cx="350" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="345" y="55" font-size="18"> 4 </text>
+
+<defs>
+<marker id='head' orient="auto" markerWidth='4' markerHeight='8' refX='0.2' refY='3'>
+<path d='M0,0 V6 L3,3 Z' />
+</marker>
+</defs>
+
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M80,50 L110,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M180,50 L210,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M280,50 L310,50' />
+
+</svg>
+

+ 37 - 0
concepts_commits_2.svg

@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="600" height="200" >
+
+<circle cx="50" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="45" y="55" font-size="18"> 1 </text>
+
+<circle cx="150" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="145" y="55" font-size="18"> 2 </text>
+
+<circle cx="250" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="245" y="55" font-size="18"> 3 </text>
+
+<circle cx="350" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="345" y="55" font-size="18"> 4 </text>
+
+<circle cx="250" cy="150" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="245" y="155" font-size="18"> 5 </text>
+
+<circle cx="350" cy="150" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="345" y="155" font-size="18"> 6 </text>
+
+<defs>
+<marker id='head' orient="auto" markerWidth='4' markerHeight='8' refX='0.2' refY='3'>
+<path d='M0,0 V6 L3,3 Z' />
+</marker>
+</defs>
+
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M80,50 L110,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M180,50 L210,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M280,50 L310,50' />
+
+<path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black' 
+    d=' M150,80 C150,150 210,150 210,150 ' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M280,150 L310,150' />
+
+</svg>
+

+ 43 - 0
concepts_commits_3.svg

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="600" height="200" >
+
+<circle cx="50" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="45" y="55" font-size="18"> 1 </text>
+
+<circle cx="150" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="145" y="55" font-size="18"> 2 </text>
+
+<circle cx="250" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="245" y="55" font-size="18"> 3 </text>
+
+<circle cx="350" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="345" y="55" font-size="18"> 4 </text>
+
+<circle cx="450" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="445" y="55" font-size="18"> 7 </text>
+
+<circle cx="250" cy="150" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="245" y="155" font-size="18"> 5 </text>
+
+<circle cx="350" cy="150" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="345" y="155" font-size="18"> 6 </text>
+
+<defs>
+<marker id='head' orient="auto" markerWidth='4' markerHeight='8' refX='0.2' refY='3'>
+<path d='M0,0 V6 L3,3 Z' />
+</marker>
+</defs>
+
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M80,50 L110,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M180,50 L210,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M280,50 L310,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M380,50 L410,50' />
+
+<path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black' 
+    d=' M150,80 C150,150 210,150 210,150 ' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M280,150 L310,150' />
+<path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black' 
+    d=' M380,150 C380,150 450,150 450,90 ' />
+
+</svg>
+

+ 0 - 24
concepts_depots.svg

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-
-<svg xmlns="http://www.w3.org/2000/svg" width="600" height="300" >
-
-            <circle cx="100" cy="100" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="95" y="105" font-size="18"> 1 </text>
-
-            <circle cx="300" cy="100" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="295" y="105" font-size="18"> 4 </text>
-
-            <circle cx="500" cy="100" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="495" y="105" font-size="18"> 6 </text>
-
-            <defs>
-              <marker id='head' orient="auto" markerWidth='4' markerHeight='8' refX='0.2' refY='3'>
-                <path d='M0,0 V6 L3,3 Z' />
-              </marker>
-            </defs>
-
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,50 C250,20 350,20 450,120' />
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,100 L250,100 ' />
-
-</svg>
-

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
concepts_depots_git.svg


Fichier diff supprimé car celui-ci est trop grand
+ 1 - 0
concepts_depots_svn.svg


+ 34 - 40
dessin.svg

@@ -1,55 +1,49 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
-
 <svg xmlns="http://www.w3.org/2000/svg" width="600" height="300" >
 
-            <circle cx="100" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="95" y="55" font-size="18"> 1 </text>
-            <circle cx="100" cy="150" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="95" y="155" font-size="18"> 2 </text>
-            <circle cx="100" cy="250" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="95" y="255" font-size="18"> 3 </text>
+<circle cx="50" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="45" y="55" font-size="18"> 1 </text>
+
+<circle cx="150" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="145" y="55" font-size="18"> 2 </text>
 
-            <circle cx="300" cy="100" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="295" y="105" font-size="18"> 4 </text>
-            <circle cx="300" cy="200" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="295" y="205" font-size="18"> 5 </text>
+<circle cx="250" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="245" y="55" font-size="18"> 3 </text>
 
-            <circle cx="500" cy="150" r="30" stroke="black" stroke-width="3" fill="lightgreen"  />
-            <text x="495" y="155" font-size="18"> 6 </text>
+<circle cx="350" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="345" y="55" font-size="18"> 4 </text>
 
-            <defs>
-              <marker id='head' orient="auto" markerWidth='4' markerHeight='8' refX='0.2' refY='3'>
-                <path d='M0,0 V6 L3,3 Z' />
-              </marker>
-            </defs>
+<circle cx="450" cy="50" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="445" y="55" font-size="18"> 5 </text>
 
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d='M20,50 L50,50' />
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M20,150 L50,150 ' />
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M20,250 L50,250 ' />
+<circle cx="250" cy="150" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="245" y="155" font-size="18"> 6 </text>
 
-            <text x="290" y="30" font-size="14"> 0.4 </text>
-            <text x="190" y="60" font-size="14"> 0.2 </text>
-            <text x="185" y="100" font-size="14"> -0.3 </text>
-            <text x="150" y="130" font-size="14"> 0.1 </text>
-            <text x="170" y="160" font-size="14"> -0.2 </text>
-            <text x="150" y="200" font-size="14"> 0.3 </text>
-            <text x="180" y="230" font-size="14"> 0.4 </text>
-            <text x="370" y="140" font-size="14"> -0.4 </text>
-            <text x="390" y="200" font-size="14"> 0.5 </text>
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,50 C250,20 350,20 450,120' />
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,50 L250,80 ' />
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,50 L250,180 ' />
+<circle cx="350" cy="250" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="345" y="255" font-size="18"> 7 </text>
 
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,150 L250,100 ' />
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,150 L250,200 ' />
+<circle cx="350" cy="150" r="30" stroke="black" stroke-width="3" fill="lightgreen"/>
+<text x="345" y="155" font-size="18"> 8 </text>
 
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,250 L250,120 ' />
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M140,250 L250,220 ' />
+<defs>
+<marker id='head' orient="auto" markerWidth='4' markerHeight='8' refX='0.2' refY='3'>
+<path d='M0,0 V6 L3,3 Z' />
+</marker>
+</defs>
 
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M340,100 L450,140 ' />
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M340,200 L450,160 ' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M80,50 L110,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M180,50 L210,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M280,50 L310,50' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M380,50 L410,50' />
 
-            <path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black'  d=' M540,150 L570,150 ' />
+<path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black' 
+    d=' M150,80 C150,150 210,150 210,150 ' />
+<path marker-end='url(#head)' stroke-width='3' stroke='black' d='M280,150 L310,150' />
+<path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black' 
+    d=' M380,150 C380,150 450,150 450,90 ' />
 
+<path marker-end='url(#head)' stroke-width='3' fill='none' stroke='black' 
+    d=' M250,180 C250,250 310,250 310,250 ' />
 
 </svg>
+

+ 61 - 12
index.md

@@ -9,8 +9,9 @@ output:
 ## Introduction
 
 ### À qui s'adresse ce tutoriel ?
-- Objectif du tutoriel : apprendre à utiliser le logiciel git et le serveur
-  gogs mis en place par le SCOSI. 
+- Objectif du tutoriel : apprendre à utiliser le logiciel git et le [serveur
+  gogs](https://gogs.univ-littoral.fr) mis en place par le
+[SCOSI](http://scosi.univ-littoral.fr/). 
 - Pré-requis : utilisation basique d'un ordinateur.
 - Public visé : les développeurs au sens large (code latex, python, matlab, R,
   java...)
@@ -21,31 +22,78 @@ output:
 - gogs : service d'hébergement de code source utilisable avec git (alternative
   à github, bitbucket...)
 
-### Qu'est-ce-que git et gogs peuvent m'apporter ?
-- journalisation :
-- sauvegarde distante :
-- synchronisation :
-- travail en équipe :
-- projets publics ou privés : 
+### Dans quels cas utiliser git/gogs ?
+- journalisation 
+- sauvegarde distante 
+- synchronisation 
+- travail en équipe 
+- projets publics ou privés :
+
+**-> Principalement sur des fichiers textes !!!** 
+
+### Dans quels cas ne pas utiliser git/gogs ?
+- édition collaborative en temps-réel -> sharelatex
+- partage de fichiers -> serveur ftp, http...
+- fichiers dans un format non textuel (jpg, word, excel...) -> dropbox
 
 ### Concepts de base
 
-commit, branche
+#### Notion de "version" (commit)
+
+Un "projet git" contient l'historique de toutes les modifications de chaque
+fichier.  On appelle "commit" un état sauvegardé de ces modifications (une
+version du projet en quelque sorte).
+
+Généralement, on modifie le projet à partir de la version précédente et ansi de
+suite; ce qui correspond à une succession de commits :
+
+![](concepts_commits_1.svg)
+
+Mais on peut également effectuer des modifications en parallèles. On appelle ça
+des branches :
+
+![](concepts_commits_2.svg)
+
+On peut ensuite rassembler ces modifications en fusionnant les branches :
 
-![](concepts_commits.svg)
+![](concepts_commits_3.svg)
 
+#### Notion de dépôt (repository)
 
-depot local / distant
+On appelle dépôt l'ensemble des fichiers de notre "projet git", avec
+l'historique des commits.
 
-![](concepts_depots.svg)
+Un dépôt peut être dupliqué sur différentes machines, pour synchroniser les
+données ou pour travailler en équipe. 
+
+Dans l'ancien temps des années 2000, on avait un dépôt principal distant que
+l'on synchronisait ou modifiait via des copies locales partielles (subversion,
+CVS...) :
+
+<img src="concepts_depots_svn.svg" style="width:800px">
+
+Aujourd'hui, on utilise plutôt des dépôts décentralisés (git, mercurial...).
+Avec ce système, tous les dépôts sont identiques et peuvent se synchroniser
+entre eux :
+
+<img src="concepts_depots_git.svg" style="width:800px">
+
+Généralement, on garde tout de même un dépôt sur un serveur distant accessible
+en permanence (serveur gogs, github...).
 
 
 * * * * *
 
 ## Installation et configuration
 
+Pour utiliser git, il suffit d'avoir installé le logiciel du même nom. Pour
+synchroniser des dépôts avec le serveur gogs, il faudra également une
+connexion internet.
+
 ### Installation sous Linux
 
+TODO
+
 ```
 sudo apt-get install git
 ```
@@ -76,6 +124,7 @@ git config --global user.email <email>
 
 ## Dépôt local (journaliser mon projet)
 
+
 init
 .git
 status