1. Content Addressable Storage
Git does not store "files" in the traditional sense of a file system. Instead, it acts as a key-value store. The key is the SHA-1 hash of the content, and the value is the content itself.
Before hashing, Git prepends a header to the content: blob {size}\0. This combination creates the "Blob" object.
Because the key is mathematically derived from the content, two identical files will always result in the same internal object, regardless of their filename or location. This is the foundation of Git's deduplication.
Experiment: Change a single character in the code below. Observe how the hash changes completely (the Avalanche Effect). Then change it back to restore the original hash.