diff --git a/docs/build-server-support/build-server/teamcity.md b/docs/build-server-support/build-server/teamcity.md index dfc061cdd8..3c66a62773 100644 --- a/docs/build-server-support/build-server/teamcity.md +++ b/docs/build-server-support/build-server/teamcity.md @@ -17,13 +17,17 @@ TeamCity has support for meta-runners which allow custom tasks. There is a GitVe - [Project Link](https://github.com/JetBrains/meta-runner-power-pack/tree/master/gitversion) ## Running inside TeamCity -When running in TeamCIty you have two options, run using **agent checkout** or use dynamic repositories. +When running in TeamCity you have two options, run using **agent checkout** or use dynamic repositories. ### Agent checkout For GitVersion to pick up pull requests properly you need to promote the `%teamcity.build.vcs.branch.{configurationid}%` variable to an environment variable called `Git_Branch` Just go to your build configuration, Parameters, click Add, Name should be `env.Git_Branch`, value should be `%teamcity.build.vcs.branch.{vcsid}%` where vcsid is your VCS root id. You should get auto completion for this. +For GitVersion to work with any mode requiring other than the currently built branch to calculate the version number, you need to set the configuration parameter [`teamcity.git.fetchAllHeads = true` in TeamCity](https://www.jetbrains.com/help/teamcity/git.html#Git-GeneralSettings), because TeamCity by default fetches only the current branch for building. + +To add this configuration parameter to your build configuration, go to *Parameters*, click *Add*, *Name* should be `teamcity.git.fetchAllHeads` and the value should be `true`. + ### Dynamic repositories To use server side checkout, you must use the dynamic repositories feature of GitVersion. Server side checkout sends just the files to the agent and not the actual .git folder. Dynamic repositories will clone your repo into a temp folder and use it to calculate version information.