redécoupage pour la partie git
This commit is contained in:
@@ -74,53 +74,3 @@ Index -> Dépôt: git commit -m "commit initial"
|
|||||||
=== Référence utile
|
=== Référence utile
|
||||||
|
|
||||||
https://ndpsoftware.com/git-cheatsheet.html[https://ndpsoftware.com/git-cheatsheet.html]
|
https://ndpsoftware.com/git-cheatsheet.html[https://ndpsoftware.com/git-cheatsheet.html]
|
||||||
|
|
||||||
== Travailler avec les branches
|
|
||||||
|
|
||||||
=== Git est un graphe
|
|
||||||
|
|
||||||
//[.stretch]
|
|
||||||
[graphviz,git-graph,svg]
|
|
||||||
----
|
|
||||||
digraph g {
|
|
||||||
rankdir = LR
|
|
||||||
node[group=master];
|
|
||||||
1 -> 2 -> 3 -> 4 -> 7
|
|
||||||
node[group=branch];
|
|
||||||
2 -> 5 -> 6
|
|
||||||
node[group=refs shape=note style=filled fillcolor=yellow];
|
|
||||||
edge[arrowhead = none style=dotted]
|
|
||||||
7 -> master
|
|
||||||
6 -> relecture
|
|
||||||
master -> HEAD
|
|
||||||
}
|
|
||||||
----
|
|
||||||
|
|
||||||
[.step]
|
|
||||||
* commit : 0 à n parent(s) + auteur + committer + message + état des fichiers
|
|
||||||
* "master", "relecture" : branche, référence à un commit
|
|
||||||
* "HEAD" : référence à la branche ou au commit sur lequel est basé l'espace de travail
|
|
||||||
|
|
||||||
=== Pour la culture
|
|
||||||
|
|
||||||
Allons voir les entrailles du dépôt...
|
|
||||||
|
|
||||||
[.stretch]
|
|
||||||
[source,shell]
|
|
||||||
----
|
|
||||||
$ cat .git/refs/heads/master
|
|
||||||
8b3e8234ccad7d9213bb28d1e70351ebeff965c8 # différent pour chacun
|
|
||||||
|
|
||||||
$ git cat-file -p 8b3e8234ccad7d9213bb28d1e70351ebeff965c8
|
|
||||||
tree 1ee6881b1653531a8fc24057be0c61d82b8325de
|
|
||||||
parent b4c8004bffba2d54753f906f5aa146a6d1ff4bef
|
|
||||||
author Yves Dubromelle <yves+git@dubronetwork.fr> 1587331162 +0200
|
|
||||||
committer Yves Dubromelle <yves+git@dubronetwork.fr> 1587331162 +0200
|
|
||||||
|
|
||||||
mon super message de commit
|
|
||||||
----
|
|
||||||
|
|
||||||
=== Créer une branche
|
|
||||||
|
|
||||||
[.step]
|
|
||||||
* On veut relire
|
|
||||||
|
|||||||
96
src/4-internals.adoc
Normal file
96
src/4-internals.adoc
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
== Les entrailles de Git
|
||||||
|
|
||||||
|
=== Git est un graphe
|
||||||
|
|
||||||
|
//[.stretch]
|
||||||
|
[graphviz,git-graph,svg]
|
||||||
|
----
|
||||||
|
digraph g {
|
||||||
|
rankdir = LR
|
||||||
|
node[group=master];
|
||||||
|
1 -> 2 -> 3 -> 4 -> 7
|
||||||
|
node[group=branch];
|
||||||
|
2 -> 5 -> 6
|
||||||
|
node[group=refs shape=note style=filled fillcolor=yellow];
|
||||||
|
edge[arrowhead = none style=dotted]
|
||||||
|
7 -> master
|
||||||
|
6 -> relecture
|
||||||
|
master -> HEAD
|
||||||
|
}
|
||||||
|
----
|
||||||
|
|
||||||
|
[.step]
|
||||||
|
* commit : 0 à n parent(s) + auteur + committer + message + état des fichiers
|
||||||
|
* "master", "relecture" : branche, référence à un commit
|
||||||
|
* "HEAD" : référence à la branche ou au commit sur lequel est basé l'espace de travail
|
||||||
|
|
||||||
|
=== Exploration du graphe
|
||||||
|
|
||||||
|
Que contient la référence master de `super_projet` ?
|
||||||
|
[source,shell]
|
||||||
|
----
|
||||||
|
$ cat .git/refs/heads/master
|
||||||
|
8b3e8234ccad7d9213bb28d1e70351ebeff965c8
|
||||||
|
----
|
||||||
|
Git peut afficher le contenu du blob correspondant au hash, ici le commit référencé par la branche `master`
|
||||||
|
[source,shell]
|
||||||
|
----
|
||||||
|
$ git cat-file -p 8b3e8234ccad7d9213bb28d1e70351ebeff965c8
|
||||||
|
tree 1ee6881b1653531a8fc24057be0c61d82b8325de
|
||||||
|
parent b4c8004bffba2d54753f906f5aa146a6d1ff4bef
|
||||||
|
author Yves Dubromelle <yves+git@dubronetwork.fr> 1587331162 +0200
|
||||||
|
committer Yves Dubromelle <yves+git@dubronetwork.fr> 1587331162 +0200
|
||||||
|
|
||||||
|
greeetings
|
||||||
|
----
|
||||||
|
|
||||||
|
=== !
|
||||||
|
|
||||||
|
Hash du commit parent ?
|
||||||
|
[source,shell]
|
||||||
|
----
|
||||||
|
$ git cat-file -p b4c8004bffba2d54753f906f5aa146a6d1ff4bef
|
||||||
|
tree 19babb3bd3373b4b98e6d0a3b03aef4606dac4b6
|
||||||
|
author Yves Dubromelle <yves+git@dubronetwork.fr> 1587311802 +0200
|
||||||
|
committer Yves Dubromelle <yves+git@dubronetwork.fr> 1587311802 +0200
|
||||||
|
|
||||||
|
commit initial
|
||||||
|
----
|
||||||
|
Qu'y a t'il dans tree ?
|
||||||
|
[source,shell]
|
||||||
|
----
|
||||||
|
$ git cat-file -p 1ee6881b1653531a8fc24057be0c61d82b8325de
|
||||||
|
100644 blob 28d0af969b32e69a389087d7a267a2ecc05f1350 rapport.md
|
||||||
|
----
|
||||||
|
Contenu de rapport.md ?
|
||||||
|
[source,shell]
|
||||||
|
----
|
||||||
|
$ git cat-file -p 28d0af969b32e69a389087d7a267a2ecc05f1350
|
||||||
|
coucou
|
||||||
|
----
|
||||||
|
|
||||||
|
=== !
|
||||||
|
|
||||||
|
Tous ces blobs référencés par leur hash sha1 sont présents dans .git/objects !
|
||||||
|
|
||||||
|
[source,shell]
|
||||||
|
----
|
||||||
|
$ tree .git/objects/
|
||||||
|
.git/objects/
|
||||||
|
├── 19
|
||||||
|
│ └── babb3bd3373b4b98e6d0a3b03aef4606dac4b6
|
||||||
|
├── 1e
|
||||||
|
│ └── e6881b1653531a8fc24057be0c61d82b8325de
|
||||||
|
├── 28
|
||||||
|
│ └── d0af969b32e69a389087d7a267a2ecc05f1350
|
||||||
|
├── 8b
|
||||||
|
│ └── 3e8234ccad7d9213bb28d1e70351ebeff965c8
|
||||||
|
├── b4
|
||||||
|
│ └── c8004bffba2d54753f906f5aa146a6d1ff4bef
|
||||||
|
├── e6
|
||||||
|
│ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391
|
||||||
|
├── info
|
||||||
|
└── pack
|
||||||
|
|
||||||
|
8 directories, 6 files
|
||||||
|
----
|
||||||
6
src/5-branches.adoc
Normal file
6
src/5-branches.adoc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
== Travailler avec les branches
|
||||||
|
|
||||||
|
=== Créer une branche
|
||||||
|
|
||||||
|
[.step]
|
||||||
|
* On veut relire no
|
||||||
@@ -13,4 +13,8 @@ include::1-cpold.adoc[]
|
|||||||
|
|
||||||
include::2-scm-flavors.adoc[]
|
include::2-scm-flavors.adoc[]
|
||||||
|
|
||||||
include::3-git.adoc[]
|
include::3-git.adoc[]
|
||||||
|
|
||||||
|
include::4-internals.adoc[]
|
||||||
|
|
||||||
|
include::5-branches.adoc[]
|
||||||
Reference in New Issue
Block a user