Ingen beskrivning
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.

gct.sh 686B

1234567891011121314151617181920212223242526
  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. git tag -a "$TAG_VERSION" -m "$COMMIT_MSG"
  15. # 或者方法2:如果你需要GPG签名,使用这个
  16. # GIT_EDITOR=true git tag -s "$TAG_VERSION" -m "Release $TAG_VERSION"
  17. # 推送标签
  18. git push origin "$TAG_VERSION"
  19. echo "完成!"