mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-17 20:50:44 +00:00
35 lines
631 B
Bash
Executable File
35 lines
631 B
Bash
Executable File
#!/bin/bash
|
|
|
|
############################################################################
|
|
## git-tag
|
|
## Add (deleting, if it already exists) a git tag to a repo (both local & remote)
|
|
############################################################################
|
|
|
|
TAG=$1
|
|
if [ -z "$TAG" ]; then
|
|
echo "Usage: $0 tagname"
|
|
exit 1;
|
|
fi
|
|
|
|
if [ "$TAG" == "-l" ]; then
|
|
git tag -l;
|
|
exit 0;
|
|
fi
|
|
|
|
echo
|
|
echo "== Deleting $TAG on local"
|
|
git tag -d $TAG
|
|
|
|
echo
|
|
echo "== Deleting $TAG on remote"
|
|
git push origin :refs/tags/$TAG
|
|
|
|
echo
|
|
echo "== Creating $TAG on local"
|
|
git tag $TAG
|
|
|
|
echo
|
|
echo "== Pushing $TAG on remote"
|
|
git push origin $TAG
|
|
|