Installer GIT
sudo apt install git
$ mkdir mon-projet
$ cd mon-projet
$ git init
Dépôt Git vide initialisé dans /home/titoan/monprojet/.git/
Q: Que s'est-il passé concrètement ? Git a créé un sous-répertoire .git. Celui-ci contient un certain nombre de fichiers et dossiers :
$ ls -l .git
total 32
drwxrwxr-x 2 titoan titoan 4096 avril 28 13:07 branches
-rw-rw-r-- 1 titoan titoan 92 avril 28 13:07 config
-rw-rw-r-- 1 titoan titoan 73 avril 28 13:07 description
-rw-rw-r-- 1 titoan titoan 23 avril 28 13:07 HEAD
drwxrwxr-x 2 titoan titoan 4096 avril 28 13:07 hooks
drwxrwxr-x 2 titoan titoan 4096 avril 28 13:07 info
drwxrwxr-x 4 titoan titoan 4096 avril 28 13:07 objects
drwxrwxr-x 4 titoan titoan 4096 avril 28 13:07 refs
R: C’est titoan
Maintenant qu'on a un dépôt, on peut commencer à mettre des choses dedans. créons un petit fichier :
$ echo "Git c'est de la balle !" >MonFichier.txt
Donc, ajoutons le fichier MonFichier.txt aux fichiers suivis dans ce dépôt :