Skip to content
Commencer

Lab Niveau 01 — Explorer

  • Vérifier que Git est correctement installé
  • Créer votre premier repository

Exercice 01 — Vérifier l’installation

Section titled “Exercice 01 — Vérifier l’installation”

Exécutez :

Terminal window
git --version

Résultat attendu :

git version 2.x.x

Créez un dossier git-playground/ et initialisez Git.

Terminal window
mkdir git-playground
cd git-playground
git init

Vérifiez avec :

Terminal window
git status

Résultat attendu :

On branch main
No commits yet
nothing to commit

  • Git est installé (git --version fonctionne)
  • Un dossier git-playground/ a été créé
  • git init a été exécuté avec succès
  • git status affiche “On branch main”
  • Le dossier .git est présent

  • Terminal et vérification de l’environnement
  • git init et git status

Question

Quelle commande vérifie la version de Git installée ?

Cliquer pour révéler la réponse
Réponse

git --version

Cliquer pour voir la question
Question

Que fait la commande git init ?

Cliquer pour révéler la réponse
Réponse

Elle initialise un nouveau dépôt Git dans le dossier courant

Cliquer pour voir la question
Question

Quelle commande affiche l'état du dépôt ?

Cliquer pour révéler la réponse
Réponse

git status

Cliquer pour voir la question

1. Quelle commande permet de vérifier que Git est installé ?

2. Quelle commande initialise un nouveau dépôt Git ?

3. Quelle commande affiche l'état actuel du dépôt ?

HashCode Workshops
Part of the JoinHashCode ecosystem

Ctrl + K Rechercher dans les workshops