sync: 自动同步未提交变更 [create TASK-20260323233732]

This commit is contained in:
cfdaily
2026-03-23 23:37:32 +08:00
parent 9933494281
commit 948b9b1603
6 changed files with 117 additions and 13 deletions
+5 -7
View File
@@ -18,22 +18,20 @@ echo "$1" >> "$TASK_FILE"
# 改进:每次创建前自动commit所有现有变更,解决批量创建时的unstaged changes问题
echo "🔄 正在同步现有变更..."
git add . > /dev/null 2>&1
# 如果有变更就commit
# 如果有变更就commit,失败(nothing to commit)也继续往下走
git commit -m "sync: 自动同步未提交变更 [create $TASK_ID]" > /dev/null 2>&1
# commit失败也继续,不退出
echo "🔄 正在拉取最新代码..."
git pull origin main
if [ $? -ne 0 ]; then
echo "⚠️ git pull 失败,请先解决冲突后再"
echo "⚠️ git pull 失败,请先解决冲突后再"
exit 1
fi
git add "$TASK_FILE"
git commit -m "feat: 创建新任务 $TASK_ID"
if [ $? -ne 0 ]; then
echo "⚠️ git commit 失败"
exit 1
fi
# commit失败也继续
git commit -m "feat: 创建新任务 $TASK_ID" > /dev/null 2>&1
git push origin main
if [ $? -ne 0 ]; then