Reputation: 65516
I have a branch that is committed and synced to TFS 2015.
When running a build on the build agent the gitversion command executed computes a different version.
Locally I get 3.11.0 based on tag 3.10.0.202
On the build agent I get 0.1.0
I feel the change may be related to how the clone is done on the build agent. Can anyone suggest if that seems likely and what might be the difference?
N.B.
Upvotes: 2
Views: 1448
Reputation: 31083
I could reproduce your scenario by creating a Tag to a history of a branch, and running the gitversion command:
Then I committed and pushed this branch to TFS 2015, on build agent machine, I ran the gitversion command:
In order to found out why they were different, I logged into TFS build agent machine and pulled the branch, I found there was no tag on the branch. That's because using sync or push in Visual Studio would not push the tag.
While GitVersion Docs mentions, if a commit is tagged, then GitVersion will always use that version over any calculated versions. This is so if you rebuild a tag then the same version will be produced.
In conclusion, VS doesn't push the Tag cause this difference. To push the Tag, you have to use command git push --tags
.
Upvotes: 5