We have a master branch. I created a new branch off master called some_feature. When I created this new branch, the master latest tag was 3.2.0. Later, few releases were cut by other team members and master branch tag got updated to 3.4.0.
However, my branch tag is still at 3.2.0. I confirmed it by running the following command:
author$ git describe --abbrev=0
3.2.0
Now, what happens is that when I run a build on Jenkins off my branch some_feature I get an error saying
ERROR: Build aborted, Git tag 3.3.0 already exists
So, what I did was to rebase my branch from the master. But, clearly, the rebase is not helping me at all. My branch is still stuck at 3.2.0.
So my question is, how do I update my tag or do something so that the tag in my local branch becomes same as the master branch which is 3.4.0?
There were few comments inquiring whether I pulled the latest code from the master before I rebased the branch some_feature. I have a habit of first fetching everything from the master and then, pulling the latest code. And, then I rebase. But, I will concede, I did some mistake, somewhere or else rebase would have worked.
But, I got over this hurdle and Jenkins was able to create a build. I did the following:
I, manually, created a new tag 3.5.0 in some_feature branch as follows:
git tag -a 3.5.0 -m "Manually setting to tag 3.5.0"
Then, I pushed the tag to the remote branch
git push origin 3.5.0
After that, Jenkins was happy!!