Reputation: 419
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
After code changes -- deleting
git tag -d 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.
Upvotes: 1
Views: 2557
Reputation: 1323145
Every build changes should be tagged. so that we can get the specific commit at anytime.
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
), using
VERSION=`git describe --dirty |sed -e "s/^[^0-9]*//"`
Other examples:
*.properties
"That way:
Upvotes: 2