Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add script to recreate v1 tag #25

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions scripts/recreate-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# This script recreates tag v1 in the repository
# It will:
# 1. Fetch all tags and prune them
# 2. Checkout the main branch
# 3. Delete the tag v1
# 4. Push the deletion of the tag v1
# 5. Create the tag v1


TAG_NAME="v1"

git fetch --tags --prune-tags -f
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually force push from local but should be the same

git checkout origin/main
git tag -d $TAG_NAME
git tag v1
git push origin tag v1 -f

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is meant to be run from local (and it's forced -f), so yes, I guess it's the same 😅

git checkout origin/main
git tag -d $TAG_NAME
git push --delete origin $TAG_NAME
git tag $TAG_NAME
git push origin $TAG_NAME
Loading