Build your own Git

Learn about git objects, plumbing commands and more

In this challenge, you'll build a Git implementation that can initialize a repository, create commits and clone a public repository from GitHub. Along the way, you'll learn about the .git directory, Git objects (blobs, commits, trees etc.), packfiles, Git's transfer protocols and much more.


Initialize the .git directory
< 5 minutes

In this stage, you'll implement the git init command. You'll initialize a git repository by creating a .git directory and some files inside it.

Read a blob object
30m - 1h

In this stage, you'll read a blob from your git repository by fetching its contents from the .git/objects directory.

You'll do this using the first of multiple "plumbing" commands we'll encounter in this challenge: git cat-file.

show all...