Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. # 使用命令行参数,如果没有提供则使用默认值
  3. COMMIT_MSG="${1:-初始提交}"
  4. TAG_VERSION="${2:-v0.1.0}"
  5. echo "提交信息: $COMMIT_MSG"
  6. echo "标签版本: $TAG_VERSION"
  7. # 提交和推送
  8. git add .
  9. git commit -m "$COMMIT_MSG"
  10. git push -u origin master
  11. # 创建标签(关键修改在这里)
  12. # 方法1:使用注释标签(推荐,不会打开编辑器)
  13. git tag -a "$TAG_VERSION" -m "Release $TAG_VERSION"
  14. # 或者方法2:如果你需要GPG签名,使用这个
  15. # GIT_EDITOR=true git tag -s "$TAG_VERSION" -m "Release $TAG_VERSION"
  16. # 推送标签
  17. git push origin "$TAG_VERSION"
  18. echo "完成!"