像黏土一样灵活塑造你的代码历史 / Shape your code history like clay
Clay 是一个专为快速原型开发设计的轻量级版本控制系统,相比 Git 更加简单直观,特别适合:
- 项目初期频繁迭代
- 实验性代码探索
- 教学/学习场景
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
功能 / Feature | 命令示例 / Example Command |
---|---|
自动快照 / Auto-snapshots | 每30秒自动保存代码状态 |
时间旅行 / Time travel | clay rewind 14:30 |
临时分支 / Temp branches | clay branch --temp |
一键撤销 / One-click undo | clay undo |
Note: bsdiff和bspatch已包含在项目中,但是可能需要手动安装lzm4
git clone https://github.com/MengAiDev/clay.git
cd clay
git clone https://github.com/lz4/lz4 third_party && cd third_party/lz4
make
cd ../..
mkdir build && cd build
cmake .. && make
sudo make install
你也可以下载github workflow构建产物。 You can also download the github workflow build product.
There are still some issues, please wait.
# 初始化仓库 / Initialize repository
clay init
# 查看历史时间轴 / View timeline
clay timeline
# 手动创建快照 / Manual snapshot
clay commit "重构用户模块"
# 回到5分钟前的状态 / Rewind 5 minutes
clay rewind 5min
# 创建临时实验分支 / Create temp branch
clay branch --temp
# 查看指定的commit与前一个的差异(仍存在问题)/ See the difference between the specified commit and the previous one (still having issues)
clay diff "time"
场景 / Scenario | Git | Clay |
---|---|---|
保存当前状态 / Save | git add . && git commit -m "..." |
自动完成 / Auto-saved |
试验性编码 / Experiment | 需新建分支 / Need new branch | clay branch --temp (内存分支 / In-memory) |
-
🧱 零配置:开箱即用,无需复杂设置
-
⚡ 瞬时回溯:像 CTRL+Z 一样回退代码版本
-
🧪 实验友好:临时分支不污染主代码库
-
🧱 Zero-config: Works out of the box
-
⚡ Instant rewind: Version control like CTRL+Z
-
🧪 Experiment-friendly: Temp branches won't pollute main code
欢迎提交 PR 或 Issue!
We welcome PRs and issues!