... | ... | @@ -228,9 +228,9 @@ Une ligne de texte |
|
|
On valide une nouvelle version incluant ce fichier :
|
|
|
|
|
|
```
|
|
|
MacBook-Air-749:gitlab-bases sebastienjean$ git add unFichier.txt
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ git commit -m "ajout d'un fichier"
|
|
|
[main deebe14] ajout d'un fichier
|
|
|
sebastienjean@MacBook-Air-749 gitlab-bases % git add unFichier.txt
|
|
|
sebastienjean@MacBook-Air-749 gitlab-bases % git commit -m "ajout d'un fichier"
|
|
|
[main 425ba5e] ajout d'un fichier
|
|
|
1 file changed, 1 insertion(+)
|
|
|
create mode 100644 unFichier.txt
|
|
|
```
|
... | ... | @@ -238,16 +238,16 @@ MacBook-Air-749:gitlab-basics sebastienjean$ git commit -m "ajout d'un fichier" |
|
|
La commande `git log` indique que les pointeurs `HEAD` et `main` sont en avance d'un commit par rapport à `origin/main`, ce qui veut signifie que le dépôt local est en avance d'un commit par rapport au dépôt distant.
|
|
|
|
|
|
```bash
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ git log
|
|
|
commit deebe1462a849bdf6702b5d8064fcee2b479d9d6 (HEAD -> main)
|
|
|
Author: sebastienjean <baz.jean@gmail.com>
|
|
|
Date: Sun Jan 23 21:31:04 2022 +0100
|
|
|
sebastienjean@MacBook-Air-749 gitlab-bases % git log
|
|
|
commit 425ba5e6883161f2c01aba66e7279b4aabddb5e7 (HEAD -> main)
|
|
|
Author: sebastienjean <sebastien.jean@univ-grenoble-alpes.fr>
|
|
|
Date: Sun Sep 25 09:37:30 2022 +0200
|
|
|
|
|
|
ajout d'un fichier
|
|
|
|
|
|
commit fd7357b0eda5a17ed4b66b995751219f303a85cd (origin/main, origin/HEAD)
|
|
|
commit 23b7e5413195e7804fdd5bb7de4fb3efe1f63180 (origin/main, origin/HEAD)
|
|
|
Author: Sebastien Jean <sebastien.jean@univ-grenoble-alpes.fr>
|
|
|
Date: Sun Jan 23 10:13:01 2022 +0000
|
|
|
Date: Sun Sep 25 07:18:39 2022 +0000
|
|
|
|
|
|
Initial commit
|
|
|
```
|
... | ... | @@ -255,7 +255,7 @@ Date: Sun Jan 23 10:13:01 2022 +0000 |
|
|
Ceci est confirmé par la commande `git status` :
|
|
|
|
|
|
```bash
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ git status
|
|
|
sebastienjean@MacBook-Air-749 gitlab-bases % git status
|
|
|
On branch main
|
|
|
Your branch is ahead of 'origin/main' by 1 commit.
|
|
|
(use "git push" to publish your local commits)
|
... | ... | @@ -280,8 +280,8 @@ Lors de cette opération : |
|
|

|
|
|
|
|
|
- il détermine ce qui doit être transmis au serveur distant (ici, le commit `1`, accroché à `0`)
|
|
|
- il dialogue avec le serveur pour échanger le ou les commits manquants
|
|
|
- _il lui indique ici que le commit `deebe146` soit être raccroché à la suite du commit `fd7357b0`_
|
|
|
- il dialogue avec le serveur pour échanger le ou les commits manquants et comment les intégrer
|
|
|
- _il lui indique ici que le commit_ `425ba5e` _soit être raccroché à la suite du commit_ `23b7e54`
|
|
|
- le serveur distant accepte ce changement, **met à jour son historique local** et en informe le client local
|
|
|
|
|
|

|
... | ... | @@ -297,32 +297,33 @@ Lors de cette opération : |
|
|
Ici, cette opération se déroule normalement et conduit à ce que les dépôts locaux et distants soient de nouveau à jour :
|
|
|
|
|
|
```bash
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ git push
|
|
|
sebastienjean@MacBook-Air-749 gitlab-bases % git push
|
|
|
Enumerating objects: 4, done.
|
|
|
Counting objects: 100% (4/4), done.
|
|
|
Delta compression using up to 4 threads
|
|
|
Compressing objects: 100% (2/2), done.
|
|
|
Writing objects: 100% (3/3), 305 bytes | 305.00 KiB/s, done.
|
|
|
Writing objects: 100% (3/3), 312 bytes | 312.00 KiB/s, done.
|
|
|
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
|
|
|
To https://gitlab.iut-valence.fr/jeans/gitlab-basics.git
|
|
|
fd7357b..deebe14 main -> main
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ git status
|
|
|
On branch main
|
|
|
Your branch is up to date with 'origin/main'.
|
|
|
To https://gitlab.iut-valence.fr/jeans/gitlab-bases.git
|
|
|
23b7e54..425ba5e main -> main
|
|
|
```
|
|
|
|
|
|
nothing to commit, working tree clean
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ git log
|
|
|
commit deebe1462a849bdf6702b5d8064fcee2b479d9d6 (HEAD -> main, origin/main, origin/HEAD)
|
|
|
Author: sebastienjean <baz.jean@gmail.com>
|
|
|
Date: Sun Jan 23 21:31:04 2022 +0100
|
|
|
La commande git log montre que le dépôt distant est à jour (pointeurs locaux et distants alignés sur le commit le plus récent) :
|
|
|
|
|
|
```plaintext
|
|
|
sebastienjean@MacBook-Air-749 gitlab-bases % git log
|
|
|
commit 425ba5e6883161f2c01aba66e7279b4aabddb5e7 (HEAD -> main, origin/main, origin/HEAD)
|
|
|
Author: sebastienjean <sebastien.jean@univ-grenoble-alpes.fr>
|
|
|
Date: Sun Sep 25 09:37:30 2022 +0200
|
|
|
|
|
|
ajout d'un fichier
|
|
|
|
|
|
commit fd7357b0eda5a17ed4b66b995751219f303a85cd
|
|
|
commit 23b7e5413195e7804fdd5bb7de4fb3efe1f63180
|
|
|
Author: Sebastien Jean <sebastien.jean@univ-grenoble-alpes.fr>
|
|
|
Date: Sun Jan 23 10:13:01 2022 +0000
|
|
|
Date: Sun Sep 25 07:18:39 2022 +0000
|
|
|
|
|
|
Initial commit
|
|
|
sebastienjean@MacBook-Air-749 gitlab-bases %
|
|
|
```
|
|
|
|
|
|

|
... | ... | |