What is Git fundamentally? To end users, it’s a version control system. But to it’s designers, it is a content addressable system.

Let’s break those words down.
Content stands for data to be stored in git. All data in git is represented as objects.
Addressable means the content can be accessed using a key or an address. You store some data, and Git returns you an ID. With this unique ID, you can ask Git to retrieve the data as and when required.
System We need a method in the madness. A system defines how the IDs will be generated, how the data will be stored, and how the interface will interact with the user.

The metadata of files are stored in trees. These are like unix directories, containing the names of each file it stores and the ID of the file. If a file is renamed or moved, the contents of the file do not change. This means only tree objects need to be changed, which makes file renaming and moves efficient in Git.

Make a minor change to an image file. This creates a new file in Git after committing.
This results in small changes taking very long to transfer across the network, and eventually eating a lot of disk space as well.

Pack files contain compressed git objects, with some having parent objects.

Git garbage collection runs when transferring over the network. That’s called pulling or pushing in Git. It also runs periodically to save disk space.

Rebasing is a way in which we take a series of commits and change their base commit. This is very useful if you’d like the history to be clean.

The important thing to note is that rebase is a way of changing history to a more coherent graph. As you can expect, there are dangers with changing history.

Git is a database for content which requires continuous versioning and peer development. We can see how important hashing, compression and commit graphs are to its architecture. Now, you can design your own version control system if you’d like to.
System Design Playlist: https://www.youtube.com/playlist?list=PLMCXHnjXnTnvo6alSjVkgxV-VH6EPyvoX

#git #software engineers #live classroom

Git for software engineers - LIVE classroom
1.25 GEEK