Git is the de facto tool for code versioning. TimeMachine is similar to Git but lighter and more flexible, and it is designed for managing general file changes, not just code.
With TimeMachine, you have a straightforward way to track and restore file changes without the complexity of a whole version control system.
I implemented deduplication and compression to make it perfect for managing large directories of binary files, documents, and project assets that traditional VCS tools don't handle optimally.
The core of TimeMachine is built using Rust, which was chosen for its memory safety and performance characteristics.
Technical Stack
- Language: Rust 2021 Edition
- Core Libraries:
- clap for command-line interface parsing
- serde for data serialization
- chrono for time management
- zstd for state-of-the-art compression
Technical Implementation
Unlike Git's complex branching and merging concepts, TimeMachine uses an intuitive snapshot-based model that anyone can grasp in minutes. It focuses solely on file versioning and restoration, making it lightweight and purpose-built. TimeMachine is designed to handle large files efficiently through compression and deduplication.
It doesn't require a unique repository structure or .git directory, making it perfect for managing any directory without affecting its organization. TimeMachine automatically handles file deduplication across snapshots, requiring no special commands or knowledge from the user.
- Smart deduplication to minimize storage overhead — only stores changed files, saving disk space
- It uses Rust's zero-cost abstractions and the zstd compression library
- SHA-2 hashing for reliable file change detection
- Cross-platform support, i.e., macOS, Windows, and Linux
- Create point-in-time snapshots of directories with a single command
- Restore files to any previous state with simple commands
Basic Usage
timemachine init ~/my-project # Initialize tracking
timemachine snapshot # Create a snapshot
timemachine restore <snapshot-id> # Restore to a previous state
Source Code and Documentation
- GitHub Repository: https://github.com/masiedu4/timemachine
- Documentation: https://github.com/masiedu4/timemachine/blob/main/CLI.md
The project is open-source under the Apache License and welcoming contributions.