Sometimes I need to apply a hotfix to an existing github tag. Instead of creating a new tag and new release it can be done to the existing one. Here are all of the steps:
Prerequisite would be to make sure you have already committed and push all new changes to the main/master branch.
Open terminal and navigate to the local repo folder
Get list of existing tags by executing:
git tag
example output:
release-20.1.0
release-20.2.0
release-20.3.0
release-21.1.0
release-21.2.0
release-21.3.0
release-22.1.0
release-22.2.0
release-22.3.0
release-22.4.0
we need to update the latest tag ‘release-22.4.0’. It will be listed at the end of the list.
First we need to delete the tag locally
git tag -d release-22.4.0
Then we need to delete the tag remotely:
git push --delete origin release-22.4.0
After that we can re-create the tag locally (it will include the latest changes from the main/master branch):
git tag release-22.4.0
And then we need to push the tag:
git push --tags
Also, if there is a Github Release created from that on Github.com, it will be in status ‘Draft’. You need to open the repo in github.com, navigate to ‘Releases’ and publish the tag.