I have a tag named tag_0.0.1 which is being pushed in the same to Git Repository. I run the build several times a day. Instead of creating new tags every time, I want to rewrite the same tag. New changes should be applied on the existing tag and it can be pushed to the repo. I know we can delete the tag on the repo and create the same in local and push it. Is there any way to apply new commits on the existing tags ?
This is what i tried:
git tag
tag_0.0.1
After code changes -- deleting
git tag -d tag_0.0.1
git push --delete origin tag_0.0.1
Recreating the same and push
git tag tag_0.0.1
git push --tags
I have a feeling about it doesn't make a sense. Is there any better ways ? I also want to know how to push the specific commit instead of pushing all of them.
Your build process should rather incorporate the last tag and the current SHA1, using
git describe
.You can see an example in "Automatic versioning in Xcode with git-describe" (or even
git describe --dirty
), usingOther examples:
*.properties
"That way: