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.gitignore
support- 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.pyc
I 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