Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
| 12345678910111213141516171819202122232425 |
- #!/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
-
- # 创建标签(关键修改在这里)
- # 方法1:使用注释标签(推荐,不会打开编辑器)
- git tag -a "$TAG_VERSION" -m "Release $TAG_VERSION"
-
- # 或者方法2:如果你需要GPG签名,使用这个
- # GIT_EDITOR=true git tag -s "$TAG_VERSION" -m "Release $TAG_VERSION"
-
- # 推送标签
- git push origin "$TAG_VERSION"
-
- echo "完成!"
|