Git CCC

Concepts, Commandes, Composants

Marc Beninca

2024 / 03

Plan

  • Concepts
    • Outils
    • Concepts
  • Commandes
    • Bases
    • Local
    • Collaborer
  • Composants
    • Basique
    • Pointeurs
    • Objets

1 Concepts

  1. Outils
  2. Concepts

1.1 Outils

1.1.1 Hachage

  • SHA-1
  • SHA-256

1.1.2 DAG / GAO

  • Graphe
  • Acyclique
  • Orienté

1.1.3 Pointeurs

  • branches
  • étiquettes

1.2 Concepts

1.2.1 Zones

  • répertoire de travail
  • index
  • historique
  • réserve

2 Commandes

  1. Bases
  2. Local
  3. Collaborer

2.1 Bases

2.1.1 git init

  • bare | non-bare

2.1.2 git config

  • system → global → local
  • user name & email
  • description

2.1.3 git status

  • -u

2.2 Local

2.2.1 Commandes

  • git branch –force
  • git add
  • git commit
  • git checkout | switch
  • git worktree
  • git merge
    • fast-forward
    • three-way
  • git rebase
    • as-is
    • merge-squash
    • cherry-pick
    • interactive
  • git reflog

2.3 Collaborer

2.3.1 Commandes

  • git remote | clone
  • git fetch | pull
  • git push
  • git tag

3 Composants

  1. Basique
  2. Pointeurs
  3. Objets

3.1 Basique

  • .git/

    • config
    • description

3.2 Pointeurs

  • .git/refs/

    1. heads/branch
    2. remotes/remote/branch
    3. tags/tag

3.3 Objets

  • .git/objects
  • git cat-file -t|-p hash
  • git update-ref refs/heads/dev hash
  • git symbolic-ref HEAD refs/heads/main
  • git hash-object -w file
  • git update-index
  • git write-tree
  • git commit-tree