Files
Mycontent/auto_sync.sh
2025-12-29 19:49:29 +08:00

25 lines
656 B
Bash
Executable File

#!/bin/bash
# 自动同步脚本:添加所有更改 -> 提交 -> 推送到 soul-content 分支
echo "⏳ 开始同步到 GitHub (soul-content)..."
# 确保在项目根目录
cd "$(dirname "$0")"
# 添加所有更改
git add .
# 检查是否有更改需要提交
if git diff-index --quiet HEAD --; then
echo "✅ 本地没有需要提交的更改。"
else
# 提交更改,包含时间戳
git commit -m "Auto-sync: $(date '+%Y-%m-%d %H:%M:%S')"
echo "✅ 已提交本地更改。"
fi
# 推送到远程
git push origin soul-content
echo "🎉 同步完成!"
echo "GitHub 地址: https://github.com/fnvtk/Mycontent/tree/soul-content"