A minimal Git-like version-control system implemented in Python for learning and projects.
Everything is stored locally in .myvcs/ — no external database.
- init, add, commit, status, log, checkout, diff
- branches (create/list/switch)
- three-way merge with conflict markers
- safety checks: prevents
checkoutandmergeif working tree is dirty (unstaged/uncommitted changes) - object storage for file blobs, commits as JSON files
vcs.py— main script (run from project root).myvcs/— created afterinit(kept private)
- Initialize repository
python3 vcs.py init
2. Add files
python3 vcs.py add README.md
python3 vcs.py add src/
3. Commit with message (Git-style)
python3 vcs.py commit -m "Initial commit"
4. View status
python3 vcs.py status
5. View commit log
python3 vcs.py log
6. Checkout commit
python3 vcs.py checkout <commit-id>