Skip to content

Commit 84b4af9

Browse files
authored
Merge pull request #1840 from jakubsuchybio/teamcity-docs
Update teamcity docs with info about fetchallheads
2 parents 358b3fc + aaa871d commit 84b4af9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

docs/build-server-support/build-server/teamcity.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@ TeamCity has support for meta-runners which allow custom tasks. There is a GitVe
1717
- [Project Link](https://github.com/JetBrains/meta-runner-power-pack/tree/master/gitversion)
1818

1919
## Running inside TeamCity
20-
When running in TeamCIty you have two options, run using **agent checkout** or use dynamic repositories.
20+
When running in TeamCity you have two options, run using **agent checkout** or use dynamic repositories.
2121

2222
### Agent checkout
2323
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`
2424

2525
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.
2626

27+
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.
28+
29+
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`.
30+
2731
### Dynamic repositories
2832
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.
2933

0 commit comments

Comments
 (0)