#!/bin/bash # 使用命令行参数,如果没有提供则使用默认值 COMMIT_MSG="${1:-初始提交}" TAG_VERSION="${2:-v0.1.0}" echo "提交信息: $COMMIT_MSG" echo "标签版本: $TAG_VERSION" git add . git commit -m "$COMMIT_MSG" git push -u origin master git tag -s "$TAG_VERSION" git push origin "$TAG_VERSION"