DEV Community

Cover image for Clay - Lightweight Version Control System
MQY
MQY

Posted on • Edited on

Clay - Lightweight Version Control System

Clay - Lightweight Version Control System

See here https://github.com/MengAiDev/clay !!
Shape your code history like clay


🌟 Overview

Clay is a lightweight version control system designed for rapid prototyping, simpler and more intuitive than Git, perfect for:

  • Early-stage project iteration
  • Experimental coding
  • Teaching/learning scenarios
# Auto-saves changes
clay init my_project  

# Rewind to any point in time  
clay rewind 10min  
Enter fullscreen mode Exit fullscreen mode

🚀 Key Features

Feature Example Command
Auto-snapshots Saves code state every 30s
Time travel clay rewind 14:30
Temp branches clay branch --temp
One-click undo clay undo

📦 Installation

Linux/macOS

git clone https://github.com/MengAiDev/clay.git  
cd clay  
mkdir build && cd build  
cmake .. && make  
sudo make install  
Enter fullscreen mode Exit fullscreen mode

Windows (requires CMake)

cmake -B build -G "Visual Studio 16 2019"  
cmake --build build --config Release  
Enter fullscreen mode Exit fullscreen mode

🛠️ Basic Usage

# Initialize repository
clay init  

# View timeline  
clay timeline  

# Manual snapshot  
clay commit "Refactor user module"  

# Rewind 5 minutes  
clay rewind 5min  

# Create temp branch  
clay branch --temp  
Enter fullscreen mode Exit fullscreen mode

🆚 VS Git

Scenario Git Clay
Save state git add . && git commit -m "..." Auto-saved
Experiment Need new branch clay branch --temp (In-memory)

🌍 Philosophy

  • 🧱 Zero-config: Works out of the box
  • Instant rewind: Version control like CTRL+Z
  • 🧪 Experiment-friendly: Temp branches won't pollute main code

🧪 Development

We welcome contribution!

📜 License

MIT License


🤝 Contributing

We welcome PRs and issues!

Top comments (4)

Collapse
 
jnareb profile image
Jakub Narębski

Git object storage is:

  • deduplicated (each version of contents is stored only once)
  • objects are stored compressed (loose storage), or deltified and compressed (pack storage) after running git gc or allowing it to run automaticaly
Collapse
 
mengaidev profile image
MQY

thank you. so what should I do?

Collapse
 
jnareb profile image
Jakub Narębski

This means that the last line in the comparison table is not correct, or not entirely correct.

Scenario:

  • Storage:
    • Git: Object bloat
    • Clay: Delta-compressed

Anyway, while I think that Clay might be a useful tool for a lone developer, the things that are (supposedly) its strength in that area, are also significant disadvantages for the use of version control system for collaboration - where small, self contained, and well described commits are the key.

Thread Thread
 
mengaidev profile image
MQY • Edited

@jakub Narębski

Thank you for the insightful follow-up! You’re absolutely right on both counts!
(If you think this is good, would you like to give me a star?)

In fact, this tool is mainly for individuals to start projects quickly and write algorithmic problems