Some times we would have added a tag, pushed it to remote and then realized that we’d named it wrong.
Ex. VER_7_2_0 instead of VER_7_1_2.
Here is quick tip to rename a git tag in the remote repo.
Step 1: Create a new tag on the same commit point of old tag and push it,
git tag new_tag old_tag
git push --tags
Step 2: Delete the old tag from local repo.
git tag -d old_tag
Step 3: Delete the old tag from remote repo.
git push origin :refs/tags/old_tag
You can verify the changes made, by executing the below command. It shows all remote tags:
git ls-remote --tags origin
Ex. VER_7_2_0 instead of VER_7_1_2.
Here is quick tip to rename a git tag in the remote repo.
Step 1: Create a new tag on the same commit point of old tag and push it,
git tag new_tag old_tag
git push --tags
Step 2: Delete the old tag from local repo.
git tag -d old_tag
Step 3: Delete the old tag from remote repo.
git push origin :refs/tags/old_tag
You can verify the changes made, by executing the below command. It shows all remote tags:
git ls-remote --tags origin
Thanks. Very helpful
ReplyDeleteThanks, Absolutely spot on, worked flawlessly.
ReplyDeleteThanks. Very helpful.
ReplyDeleteVERY helpful - thank you!
ReplyDeleteMany thanks! Clean and concise
ReplyDeleteBeat stack overflow in my search 👍
ReplyDeleteGreat and that i have a swell give: How Long Renovate House house renovation budget
ReplyDelete