Skip to content

Commit f3a43a3

Browse files
authored
Create git-autotag
1 parent 82b1fee commit f3a43a3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

git-autotag

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
TARGET_PREFIX=${1:-release}
4+
TARGET_BASE=$TARGET_PREFIX-`date +%Y%m%d`
5+
TARGET_REVISION=$((`git ls-remote --tags --heads origin | awk "/$TARGET_BASE-(.*)/ { print $1 }" | awk -F'-' '{print $3}' | sort -nr | head -n 1` + 1))
6+
TARGET_BRANCH=$TARGET_BASE-$TARGET_REVISION
7+
git tag $TARGET_BRANCH
8+
git push origin $TARGET_BRANCH
9+
echo "tagging complete under tag $TARGET_BRANCH"

0 commit comments

Comments
 (0)