Repoflow is a Git‑inspired version control system built from scratch in Python. It helps you understand how version control works internally by tracking file changes, creating commits, showing diffs, and restoring project state — without using Git internally.
This project is ideal for:
- Learning how VCS systems work
- System‑design interviews
- Demonstrating file‑system and tooling skills
- Initialize a repository (
repoflow init) - Track file changes (
repoflow status) - Create commits (
repoflow commit) - View commit history (
repoflow log) - Line‑level diffs (
repoflow diff <file>) - Restore project to an older commit (
repoflow restore cN) - Ignore system similar to
.gitignore - Safe file handling on Windows, macOS, and Linux
Repoflow v1 is intentionally minimal and educational.
-
Commits store only metadata (added / modified / deleted files)
-
File contents are NOT stored per commit
-
Restore works by:
- Restoring the base snapshot
- Replaying deletions only
-
Files added after
initcannot be reconstructed during restore
These limitations are documented design decisions, not bugs. Future versions can extend this with blob storage or diffs.
project/
├─ .repoflow/ # Repoflow internal data (hidden)
│ ├─ commits/
│ │ ├─ base/ # Base snapshot (initial files)
│ │ └─ head/ # Latest committed state
│ ├─ diffs/ # c1.json, c2.json ...
│ ├─ state.json # Tracked file hashes
│ ├─ log.json # Commit history
│ └─ config.json
│
├─ .repoflowignore # Ignore rules
└─ your_project_files
- Python 3.9+
- Windows / macOS / Linux
Check Python version:
python --version-
Create a folder, for example:
C:\repoflow\ -
Place
app.pyinside it and rename torepoflow.py -
Add the folder to PATH:
-
Search Environment Variables
-
Edit Path
-
Add:
C:\repoflow
-
-
Restart terminal
Run:
python repoflow.py init(Optional) Create repoflow.bat:
@echo off
python C:\repoflow\repoflow.py %*Then you can run:
repoflow initmv app.py repoflow
chmod +x repoflow
sudo mv repoflow /usr/local/bin/Run:
repoflow initInitializes Repoflow in the current directory.
repoflow initOutput:
Repoflow initialized
Shows uncommitted changes.
repoflow statusExample output:
Changes not committed:
Modified:
app.py
Added:
test.txt
If clean:
Working tree clean.
Creates a new commit.
repoflow commitOutput:
Committed as c1
Added: 1
Modified: 2
Deleted: 0
Commit messages are fixed in v1. Designed to support
-min v2.
Displays commit history.
repoflow logOutput:
commit c2
Date: 2026-01-29T18:45:10
Commit
----------------------------------------
commit c1
Date: 2026-01-29T18:40:02
Commit
----------------------------------------
Shows line‑level differences against last commit.
repoflow diff app.pyOutput:
--- a/app.py
+++ b/app.py
@@ -12,6 +12,7 @@
+import difflibRestores project to a previous commit.
repoflow restore c1Prompt:
⚠ This will discard current changes.
Proceed? (y/N):
Success:
✔ Restored to commit c1
Repoflow uses .repoflowignore similar to .gitignore.
Default ignores include:
.git/,.gitignorenode_modules/.env.next/,.vercel/__pycache__/- IDE folders and build artifacts
- No Git dependency
- Hash‑based change detection
- Explicit state management
- Permission‑safe file operations (Windows)
- Honest trade‑offs documented
- Clean separation of snapshots, state, and logs
- Commit messages
- File content blobs
- Delta‑based restore
- Branching
- Remote sync
- A Web Interface to do all the operations from interface
MIT License
Built for learning, clarity, and engineering honesty.