| 123456789101112131415161718192021222324 |
- #!/bin/bash
- # 自动 Git 同步脚本 for servo_sizer 项目
- cd /home/admin/clawd
- # 设置 Git 用户信息(如果尚未设置)
- git config --global user.email "moltbot@clawd.com" || true
- git config --global user.name "Moltbot" || true
- # 添加所有更改
- git add .
- # 检查是否有待提交的更改
- if ! git diff --cached --quiet; then
- # 创建提交
- git commit -m "Auto sync: $(date '+%Y-%m-%d %H:%M:%S')"
-
- # 推送到远程仓库
- git push origin main
-
- echo "$(date): Changes synced to remote repository"
- else
- echo "$(date): No changes to sync"
- fi
|