Check out a free preview of the full Git In-depth course

The "Data Storage" Lesson is part of the full, Git In-depth course featured in this preview video. Here's what you'd learn in this lesson:

Nina reviews how Git stores information comparing it to a key-value store where data is the value and the hash of the data is the key. This system is also known as content-addressable storage, which is when the content to generate the key.


Transcript from the "Data Storage" Lesson

>> Nina Zakharenko: So what is git? We've all heard this term before. It's a distributed version control system. But in order to truly understand git, we need to learn how git stores information. At its core, git is kind of like a key value store. The value is the data, and the key is hash of the data.

You can then use the key to retrieve the content.
>> Nina Zakharenko: The key is, it's called a SHA1. It's a cryptographic hash function, so given a piece of data, it produces a 40-digit hexadecimal number. And that number, that value will always be the same if the given input is the same.

So you look at git log, you see lots of 40-digit hexadecimal numbers, those are called SHA1s. Sometimes, and this is also called, this type of system is called a content addressable storage system. And that's because you can use the content to generate the key. So if the hash is always the same given a piece of content, that also means that given the content, you can generate the key.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now