0

How does git work in the case of git add and git commit? I have a file, I make changes and do a git add, locally in the folder .git/objects creates a folder " 02 " with the file. After that, I make a git commit and in the folder .git/objects creates 2 more folders "15" and "76", each with a file. What are these files? Why are 3 objects created per one file change?

kek5
  • 3
  • 3
  • 1
    When you make a commit, git requires 3 files on disk, at the least. The commit itself, the tree, and the file. It may reuse the tree or the file objects if they are unchanged and present from other commits. The folders are named by taking the first 2 character in the git commit hash, and the filename inside are the remaining 38. – Lasse V. Karlsen Jan 22 '21 at 12:27
  • 2
    worth reading : https://git-scm.com/book/en/v2/Git-Internals-Git-Objects – LeGEC Jan 22 '21 at 12:37

0 Answers0