ai-c/git-push.sh
2026-02-04 15:48:45 +08:00

29 lines
507 B
Bash

#!/bin/bash
cd "$(dirname "$0")"
echo "========================"
echo "Git 提交脚本"
echo "========================"
echo ""
read -r -p "请输入提交信息(例如: feat: 更新小程序代码): " msg
if [ -z "$msg" ]; then
msg="chore: sync"
fi
echo "[1/3] 添加所有更改..."
git add -A
echo ""
echo "[2/3] 提交更改..."
git commit -m "$msg"
echo ""
echo "[3/3] 推送到远程仓库..."
git push
echo ""
echo "========================"
echo "完成!"
echo "========================"