Skip to content

Commit

Permalink
Get latest retag.sh from discogs_client repo
Browse files Browse the repository at this point in the history
  • Loading branch information
JOJ0 committed Apr 6, 2022
1 parent 45b5212 commit b004372
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions retag.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
#!/bin/bash
# 1) Deletes the git tag passed in $1:
# - locally
# - on the remote passed in $2
# 2) Tags HEAD again with the given version number,
# 3) and pushes commits and tags again to remote
# Additional push options can be passed in $3.

if [[ -z $1 ]]; then
echo "usage: ./retag.sh <tagname>"
if [[ -z $1 ]] || [[ -z $2 ]]; then
echo "usage: ./retag.sh <version> <remote> [additional push options]"
exit 1
fi
PUSH_OPTS="$2"

set -x
VERS=$1
REMOTE=$2
PUSH_OPTS="$3"

git tag -d $VERS; git push origin --delete $VERS; git tag $VERS; git push; git push --tags --follow-tags
git tag -d $VERS
git push $REMOTE --delete $VERS
git tag $VERS
git push
git push $REMOTE --tags --follow-tags $PUSH_OPTS

0 comments on commit b004372

Please sign in to comment.