Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Savez-vous vraiment comment fonctionne git ? - Devoxx France 2023 - Conférence

Savez-vous vraiment comment fonctionne git ? - Devoxx France 2023 - Conférence

Nous utilisons git quotidiennement. Mais connaissons-nous son réel fonctionnement ? Que faire quand une commande plante ? Pourquoi ce rebase échoue ?

Et si le contenu du répertoire .git pouvait répondre à ces questions et bien plus encore ? Découvrons donc ensemble ce mystérieux dossier et le modèle sous-jacent. Ce dernier nous donnera les clés pour mieux comprendre le fonctionnement du commit, rebase et push.

Que vous veniez de commencer à utiliser git ou que vous l'utilisiez tous les jours depuis des années, cette session vous donnera les connaissances pour passer maitre dans l'art du git.

Sébastien LECACHEUR

April 13, 2023
Tweet

More Decks by Sébastien LECACHEUR

Other Decks in Programming

Transcript

  1. commit 44c85e62 (HEAD -> devoxx France 2023) Author: Sébastien Lecacheur

    <@slecache> Org: Odigo Date: Thu APR 13 13:30:00 2023 +0000 Savez-vous vraiment comment fonctionne git ?
  2. La porcelaine (porcelain commands) • git add • git commit

    • git push • git pull • git branch • git switch • git merge • git rebase • … CMD ❌
  3. Commandes de plomberie (plumbing commands) • git hash-object • git

    cat-file • git count-objects • git show-refs • … CMD ✔
  4. La base d’objets (first commit) MODE ./ tracks/ tracks.txt Langages

    9a4b bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 README.txt
  5. La base d’objets (first commit) MODE ./ tracks/ tracks.txt Langages

    9a4b bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 langages.txt README.txt
  6. La base d’objets (versioning) MODE ./ tracks/ tracks.txt Langages 9a4b

    bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 langages.txt README.txt ⌨
  7. La base d’objets (versioning) MODE ./ tracks/ tracks.txt Langages 9a4b

    bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 langages.txt README.txt 998c ⌨
  8. La base d’objets (versioning) MODE ./ tracks/ tracks.txt Langages 9a4b

    bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 langages.txt README.txt 998c ./ 7460 ⌨
  9. La base d’objets (versioning) MODE ./ tracks/ tracks.txt Langages 9a4b

    bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 langages.txt README.txt 998c ./ 7460 0195 tracks.txt ⌨
  10. La base d’objets (versioning) MODE ./ tracks/ tracks.txt Langages 9a4b

    bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 langages.txt README.txt 998c ./ 7460 Langages Architecture 0195 tracks.txt ⌨
  11. La base d’objets (versioning) MODE ./ tracks/ tracks.txt Langages 9a4b

    bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 langages.txt README.txt 998c ./ 7460 Langages Architecture 0195 tracks.txt tracks/ ⌨
  12. La base d’objets (annotated tag) MODE ./ tracks/ tracks.txt Langages

    9a4b bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 langages.txt README.txt 998c ./ 7460 Langages Architecture 0195 tracks.txt tracks/
  13. La base d’objets (annotated tag) MODE ./ tracks/ tracks.txt Langages

    9a4b bb9a 9474 cb32 Put the tracks in this directory, one track per file. cc33 langages.txt README.txt 998c ./ 7460 Langages Architecture 0195 tracks.txt tracks/ mytag
  14. Et si les branches git n’ étaient pas ce que

    vous croyez qu’elles sont ?
  15. Les 3 règles ✔ La branche courante suit les nouveaux

    commits. ✔ Quand on se déplace vers un commit, git met à jour le répertoire de travail. ✔ Les objets inaccessibles passent au ramasse-miettes. RULES