How to force TeamCity to fetch all tags in git repo?
Completed
How to force TeamCity to fetch all tags? What I tried so far:
- force checkout on agent
- add parameter
teamcity.git.fetchAllHeads=true -
Enable to use tags in the branch specificationis checked - add
+:refs/tags/*into branch specification in VCS root settings - I tried to add build step to invoke
git fetch --tagsbut that requires SSH Agent to be running and it's failing withFailed to start SSH Agent: java.lang.RuntimeException: Cannot parse ssh-agent output: ''
Nothing works. I can see that TeamCity is fetching all branches, but no tags, so GitVersion is not able to calculate proper version.
Please sign in to leave a comment.
You should only need to add +:refs/tags/* to the branch specification and check the box for Enable to use tags in the branch specification. If you try to run a custom build, do you see the tags listed in the Changes | Build Branch drop-down?
https://www.jetbrains.com/help/teamcity/triggering-a-custom-build.html#TriggeringaCustomBuild-Buildbranch
Also, what version of TeamCity are you using? There is a build feature that you may use to connect with an SSH Agent in the latest releases. This would enable you to run the git fetch --tags to a build step in your case.
https://www.jetbrains.com/help/teamcity/ssh-agent.html#ssh-agent.md