Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Practice build · Developer tools and DevOps

Build your own Git

A Git implementation that can hash and store objects, write trees and commits, walk history and check out, compatible with real Git repositories.

  • Intermediate
  • About 10–20 h
  • 4 checkpoints
  • 4 tutorials · Python, JavaScript

Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.

Choose a tutorial

Why build it

Git's commands make sense once you know its data model: content-addressed objects, trees and refs. Building it is the fastest way to stop fearing rebase and detached HEAD.

You will be able to

  • Store blobs, trees and commits as compressed, hash-addressed objects.
  • Build trees from a directory and commits from trees.
  • Read and update refs and HEAD.
  • Walk the commit graph to show history.

Skills it exercises

Recommended on Applied AI Engineer, DevOps Engineer and Data Engineer.

Checkpoints

How you know you are there

Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.

  1. Checkpoint 1Self-check

    Objects

    Done when: mygit hash-object -w file and mygit cat-file -p <sha> agree with real Git on the same file.

  2. Checkpoint 2Self-check

    Trees and commits

    Done when: Your write-tree and commit-tree produce objects that real Git's log and show can read.

  3. Checkpoint 3Self-check

    Refs and log

    Done when: Branches and HEAD are stored as refs, and mygit log walks the history of a repository created by real Git.

  4. Checkpoint 4Self-check

    Checkout

    Done when: mygit checkout <commit> restores that commit's files, and real Git's status shows nothing changed.

Stretch goals

  • An index (staging area).
  • Merge with a merge base.
  • Push to GitHub over HTTP.
Follow a tutorial

Step-by-step guides

Pick one in a language you know (tutorial languages: Python, JavaScript). They open on the author’s site.

Where to go next

Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.

Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.