GIT: How GIT works internally?

Achraf Housni
3 min readJul 4, 2023
Photo by Roman Synkevych on Unsplash

Understanding its Internal Working

Git is a popular distributed version control system that is widely used for software development. It is essential to understand its internal working to use it efficiently and effectively. In this article, we will explore the internal working of Git and explain each concept in detail with the help of images.

Git Basics

Git is a distributed version control system that tracks changes in the source code during software development. It is based on the concept of snapshots, where each commit represents a snapshot of the codebase at a particular point in time. Git stores these snapshots as a set of files and directories in a hidden folder called `.git`.

Git Repository

A Git repository is a collection of files and directories that are managed by Git. It contains all the versions of the files, the history of changes made, and the metadata associated with each commit. A Git repository can be hosted on a remote server or locally on your computer.

Git Objects

Git stores data in four types of objects: blob, tree, commit, and tag.

Blob

A blob object represents the content of a file. It contains the contents of the file and a header that identifies the type of object…

--

--