Wyag is a Git-like version control system built from scratch in Python.
The name stands for Write Yourself A Git, inspired by the idea of learning by building.
🚀 “The best way to understand Git is to build Git.”
init– Create a new repositoryadd– Stage files to the indexcommit– Save snapshots of your codelog– View commit history as a DAGstatus– See what's staged, modified, or untrackedls-files,ls-tree,rev-parse,show-ref,tag,checkout, and more.gitignoresupport- Compatible with Windows CMD, PowerShell, and Linux shell
- Clone the project
git clone https://github.com/Debkumar-Baksi/Write_Yourself_A_Git.git
-
Move into the project folder
cd Write_Yourself_A_Git -
Initialize a new repository
python wyag init myrepo cd myrepo -
Create a file
echo Hello, Wyag! > test.txt
-
Add and commit
python ..\wyag add test.txt python ..\wyag commit -m "Initial commit"
-
View status and log
python ..\wyag status python ..\wyag log
python wyag init myrepo
python wyag add file.txt
python wyag commit -m "message"
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.pycI built Wyag to understand how Git works under the hood. By re-creating Git’s core concepts — blobs, trees, commits, refs — I gained a deeper understanding of version control, file storage, and DAG-based history.
This project helped me master:
- Git internals
- File systems and binary formats
- Hashing and data integrity
- Python I/O and CLI design
- Commit graph visualization
- Branching and merging
- Web frontend for viewing repo state
- Improved diff and patching
MIT License — free to use, share, and modify.
Made with 💻 and ☕ by Debkumar