Git as Your Data Store
+GitStore implements a versioned data store based on Git. Store object hierarchies as nested hashes, enjoy automatic versioning, and leverage Git's powerful features for your data.
+ +Why GitStore?
+Powerful features that make data management simple and reliable
+Version Control Built-in
+Every change is automatically tracked with Git's powerful versioning. Roll back to any point in time with ease.
+Transaction Support
+Atomic operations ensure data integrity. Changes either succeed completely or are rolled back entirely.
+Nested Data Structures
+Store complex object hierarchies as nested hashes, automatically mapped to the git directory structure.
+Custom Serialization
+YAML, JSON, and custom handlers for any file format. Extend easily with your own serialization logic.
+In-Memory Operations
+Data is loaded into memory for fast access. Commit changes directly to the repository without intermediate files.
+Concurrent Access
+File locking ensures safe concurrent access from multiple processes or threads.
+Simple and Intuitive API
+GitStore provides a hash-like interface for storing and retrieving data. Files are automatically serialized based on their extension, and all changes are committed to the Git repository.
+-
+
- + + Hash-like access to data + +
- + + Auto-serialization by file extension + +
- + + Built-in transaction support + +
# Initialize a store +require 'git_store' + +store = GitStore.new('/path/to/repo') + +# Store objects using paths +store['users/alice.yml'] = { + name: 'Alice', + email: 'alice@example.com' +} + +store['config/settings.yml'] = { + theme: 'dark', + language: 'en' +} + +# Commit changes +store.commit 'Added user and config' + +# Use transactions for safety +store.transaction do + store['pages/home.yml'] = page_data + store['pages/about.yml'] = about_data +end+
Get Started in Minutes
+Install GitStore and start versioning your data with Git
+Install the Gem
+gem install git_store
+ Initialize a Repository
+git init my_data_store
+ Start Using GitStore
+store = GitStore.new('.')
+