Files
soul-yongping/quick-push.sh

50 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
# Soul创业实验 - 快速上传到GitHub脚本
# 使用方法:./quick-push.sh "提交信息"
cd "/Users/karuo/Documents/开发/3、自营项目/一场soul的创业实验"
echo "🚀 开始上传到GitHubsoul-content分支..."
echo ""
# 检查是否有更改
if [ -z "$(git status --porcelain)" ]; then
echo "✅ 没有需要提交的更改"
exit 0
fi
# 添加所有更改
echo "📦 添加所有更改..."
git add -A
# 获取提交信息
if [ -n "$1" ]; then
commit_msg="$1"
else
echo "💬 请输入提交信息(留空则使用默认信息):"
read commit_msg
if [ -z "$commit_msg" ]; then
commit_msg="update: 更新内容 $(date '+%Y-%m-%d %H:%M:%S')"
fi
fi
# 提交
echo "📝 提交更改..."
git commit -m "$commit_msg"
# 推送
echo "🚀 推送到GitHub..."
git push origin soul-content
if [ $? -eq 0 ]; then
echo ""
echo "✅ 上传完成!"
echo "📝 提交信息:$commit_msg"
echo "🔗 查看https://github.com/fnvtk/Mycontent/tree/soul-content"
else
echo ""
echo "❌ 上传失败,请检查网络连接或权限"
fi