• aport@programming.dev
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    8 months ago

    Each commit includes the diff and metadata (like parent commits).

    Commits don’t store diffs, so you’re wrong from the start here.

    Hence why people say “git is hard”

    • homoludens@feddit.de
      link
      fedilink
      arrow-up
      4
      ·
      8 months ago

      Yeah, you’re right, technically it’s not a “diff”, it’s the changed files.

      I don’t think this technical detail has any consequences for the general mental model of Git though - as evidenced by the fact that I have been using Git for years without knowing this detail, and without any problems.

      • gedhrel@lemmy.world
        cake
        link
        fedilink
        arrow-up
        2
        ·
        8 months ago

        It’s all the files. Content-addreasable storage means that they might not take up any more space. Smart checkout means they might not require disk operations. But it’s the whole tree.