... | ... | @@ -220,3 +220,42 @@ Le schéma ci-dessous illustre le résultat du clonage, en montrant les branches |
|
|
</p>
|
|
|
[//]: 
|
|
|
|
|
|
### Synchronisation amont d'un dépôt local
|
|
|
|
|
|
#### Ajout d'un commit local
|
|
|
|
|
|
- création d'un nouveau fichier `unFichier.txt` à la racine du *Working Tree* :
|
|
|
|
|
|
```bash
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ cat > unFichier.txt
|
|
|
Une ligne de texte
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ more unFichier.txt
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ ls
|
|
|
README.md unFichier.txt
|
|
|
```
|
|
|
|
|
|
- validation d'une nouvealle version avec ce fichier :
|
|
|
|
|
|
```bash
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ git add unFichier.txt
|
|
|
MacBook-Air-749:gitlab-basics sebastienjean$ git commit -m "ajout d'un fichier"
|
|
|
[main deebe14] ajout d'un fichier
|
|
|
1 file changed, 1 insertion(+)
|
|
|
create mode 100644 unFichier.txt
|
|
|
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
|
|
|
|
|
|
ajout d'un fichier
|
|
|
|
|
|
commit fd7357b0eda5a17ed4b66b995751219f303a85cd (origin/main, origin/HEAD)
|
|
|
Author: Sebastien Jean <sebastien.jean@univ-grenoble-alpes.fr>
|
|
|
Date: Sun Jan 23 10:13:01 2022 +0000
|
|
|
|
|
|
Initial commit
|
|
|
```
|
|
|
|
|
|
On observe 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.
|
|
|
|
|
|
Ceci est confirmé par la commande `git status` : |
|
|
\ No newline at end of file |