A comprehensive version control filesystem that provides automatic file versioning through FUSE integration, CLI management tools, and robust storage backend.
- Automatic File Versioning: Every file modification is automatically versioned
- FUSE Integration: Mount as a transparent filesystem - works with any application
- CLI Management: Powerful command-line tools for version management
- Virtual Directories: Browse file history through
.versions/directories - Storage Backend: Efficient block-based storage with SQLite metadata
- Cross-Platform: Works on Linux, macOS, and other Unix-like systems
FileSystem/
βββ testospbl/ # Core storage backend
β βββ storage.py # StorageManager implementation
β βββ test_storage.py # Storage tests
βββ fuse_layer/ # FUSE filesystem implementation
β βββ tmfs_fuse.py # Main FUSE filesystem
β βββ mount_tmfs.py # Mount utility
β βββ test_tmfs.py # FUSE tests
β βββ README.md # FUSE documentation
βββ tmfs2/ # CLI tools
β βββ tmfs/src/
β βββ cli.py # Main CLI interface
β βββ commands/ # Individual commands
βββ complete_integration.py # Integration demo
βββ requirements.txt # Python dependencies
-
Clone the repository:
git clone https://github.com/Ghoulayush/time-machine-filesystem.git cd time-machine-filesystem -
Install dependencies:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -r requirements.txt
-
Install FUSE (if not already installed):
# Ubuntu/Debian sudo apt-get install fuse libfuse-dev # macOS brew install macfuse # CentOS/RHEL sudo yum install fuse fuse-devel
cd your_project_directory
python -c "
import sys
sys.path.insert(0, '/path/to/tmfs/testospbl')
from storage import StorageManager
storage = StorageManager('.')
print('TMFS storage initialized!')
"# Create mount point
mkdir tmfs_mount
# Mount TMFS
python /path/to/tmfs/fuse_layer/mount_tmfs.py mount . tmfs_mount
# Now work with files in tmfs_mount/ - all changes are automatically versioned!
echo "Hello World" > tmfs_mount/hello.txt
echo "Version 2" > tmfs_mount/hello.txt# List file versions
python /path/to/tmfs/tmfs2/tmfs/src/main.py list hello.txt
# Show detailed version information
python /path/to/tmfs/tmfs2/tmfs/src/main.py list hello.txt --detailed
# Restore a specific version
python /path/to/tmfs/tmfs2/tmfs/src/main.py restore hello.txt --version-id v1
# Show storage statistics
python /path/to/tmfs/tmfs2/tmfs/src/main.py info --stats# List all versions of a file
ls tmfs_mount/.versions/hello.txt/
# Read a specific version
cat tmfs_mount/.versions/hello.txt/v1
cat tmfs_mount/.versions/hello.txt/v2# Mount TMFS
python fuse_layer/mount_tmfs.py mount . mount_point
# Work normally - versioning is automatic
echo "First draft" > mount_point/document.txt
echo "Second draft" > mount_point/document.txt
echo "Final version" > mount_point/document.txt
# Check version history
python tmfs2/tmfs/src/main.py list document.txt
# Output:
# Found 3 versions for document.txt
# Version | Timestamp | User
# ----------------------------------------
# v1 | 2025-11-09 15:30:00 | user
# v2 | 2025-11-09 15:31:00 | user
# v3 | 2025-11-09 15:32:00 | user# Restore to previous version
python tmfs2/tmfs/src/main.py restore document.txt --version-id v1
# Compare versions (planned feature)
python tmfs2/tmfs/src/main.py diff document.txt --version-a v1 --version-b v3
# Clean up old versions (planned feature)
python tmfs2/tmfs/src/main.py cleanup document.txt --keep-last 5Run the comprehensive test suite:
# Test storage backend
python testospbl/test_storage.py
# Test FUSE filesystem
python fuse_layer/test_tmfs.py
# Test complete integration
python complete_integration.py- Block-based storage: Files are stored in fixed-size blocks for efficiency
- SQLite metadata: Version information, timestamps, and file relationships
- Deduplication: Identical blocks are stored only once
- Compression: Block-level compression support (planned)
- Transparent versioning: Files are automatically versioned on modification
- Virtual directories:
.versions/directories provide access to file history - Standard operations: Full support for read, write, create, delete, etc.
- Performance optimized: Efficient caching and lazy loading
- Modern interface: Clean, intuitive command-line tools
- Rich output: Detailed formatting and progress indicators
- Async support: Non-blocking operations for large datasets
- Extensible: Plugin architecture for custom commands
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Commit with clear messages:
git commit -m "Add feature description" - Push to your fork:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- FUSE unmounting requires manual
fusermount -uon some systems - CLI commands need absolute paths for cross-directory imports
- Performance optimization needed for very large files (>1GB)
- v1.1: Web interface for version browsing
- v1.2: File difference visualization
- v1.3: Automated cleanup policies
- v1.4: Network storage backends
- v1.5: Real-time collaboration features
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
Note: This is an active development project. While functional, it's recommended for development and testing environments. Production use should be carefully evaluated.