14% off through 06/01/23

Learn how Git's code works

✨ 258 sold ✨

Buy PDF Direct Download!
Image of the Decoding Git Guidebook for Developers

What is Decoding Git?

Decoding Git discusses the very first version of the Git codebase written by Linus Torvalds (the creator of Linux) in 2005. Git's original version is written in the C programming language and consists of about 1,000 lines of code and a total of 7 commands, and they actually work.

The simplicity and 'smallness' of the code make Git's initial commit the perfect codebase for you to study to learn how the code works. The fact that one of the most popular and useful tools in software development history is so simple to understand directly from its initial code is an amazing thing.

This guidebook makes the learning experience even easier, by diving into Git's original C code in detail to help you learn what makes Git tick.

Who is this book for?

  • Junior Devs
  • Senior Devs, Team Leads, CTOs
  • Curious Git users
  • Open-source contributors
  • Anyone interested in learning more about Git!


Introduction to Git's Code
An Overview of Git's Original Version
Installing Git's Original Version
Git Original Command Tutorial
The C Header File cache.h
Read the Index with read-cache.c
Initialize Git with init-db.c
Stage Files with update-cache.c
Create Trees with write-tree.c
Commit Changes with commit-tree.c
Read from the Repo with read-tree.c
View File Contents with cat-file.c
Calculate Diffs with show-diff.c


"I bought this Decoding Git book and excitedly read through the first few chapters in a few hours. Fantastic, fantastic, fantastic! It gives me a good intuitive grasp of Git. Much better than other tutorials I have read that don't start from the fundamentals. Jacob explains everything from the ground up, rather than assuming too much prior information. His logic and flow in the book are superb - the best I have seen from a coding book. Highly recommended!" -Jerry C.
"This book takes a brilliant approach of teaching git by going through the code of its initial commit. In this early version of git we see how and why git was built as it was, before it became more complex and harder to understand. Even in this initial commit there abstractions such as content addressable filesystem, but they are manageable and it helps us learn the overall organization and big picture. Seeing the actual files and code that git uses makes it make much more sense and this book is an ideal way to actually learn and understand git." -Neal C.

Get your copy

Buy PDF Direct Download!