Write Yourself A Git

Building a Git Yourself in Python

View My Work

What, How & Why?

🚀

What is this

I created a fully working version control system using only Python. Wyag supports repository initialization, staging files, committing, logging history, and more. It also implements Git’s object model — blobs, trees, and commits — and stores them in a .git/-like structure.

📱

How I Built It

I started by studying how Git stores data using commands like git cat-file and git hash-object. Then I used Python’s argparse to create a CLI with Git-like commands. I implemented SHA1 hashing, binary encoding for the index, and internal object storage. To make it work on Windows, I removed Unix-only dependencies like grp and pwd, and replaced them with Windows-friendly logic. I also fixed common issues like byte overflows, missing HEAD files, and object resolution bugs.

🎨

Why I Built Wyag

I built Wyag to truly understand how Git works at its core. We use Git commands like add and commit every day — but rarely think about what happens under the hood. Writing my own version control system gave me that insight. I also wanted to challenge myself with something low-level. Handling binary files, SHA1 hashing, and simulating Git’s internal structure taught me more than any tutorial could. Another reason was to sharpen my skills. I improved my Python, learned about file systems, and got hands-on experience with concepts like DAGs (Directed Acyclic Graphs) and Git object formats. Finally, I wanted to share something meaningful. Wyag is not just a project — it’s a learning tool for me and for others who are curious about how Git actually works.

📱

What it can do

python wyag init myrepo
python wyag add file.txt
python wyag commit -m "Initial commit"
python wyag status
python wyag ls-files
python wyag log
python wyag ls-tree HEAD
python wyag rev-parse HEAD
python wyag tag v1.0
python wyag tag
python wyag show-ref
python wyag checkout HEAD checkout-dir
python wyag rm file.txt
python wyag hash-object -w file.txt
python wyag cat-file blob <sha>
python wyag check-ignore file.pyc

About Me

I'm a passionate developer who loves creating innovative solutions and bringing ideas to life through code. With expertise in both frontend and backend technologies, I enjoy working on projects that challenge me to learn and grow.

When I'm not coding, you can find me exploring new technologies, contributing to open-source projects, or sharing knowledge with the developer community.

Get In Touch

Let's collaborate on your next project or just have a chat about technology!