【发布时间】:2021-12-29 05:35:37
【问题描述】:
我在 TeamCity 中的 GitVersion 程序出现奇怪错误。它属于由以下代码组成的无限循环。
branch0 是 branch1 和 branch2 的父级。 我正在尝试部署 branch2,但显示了与 branch1 相关的错误,它根本不应该与它有任何连接。
我也很好奇在这种情况下“开发”和“起源/开发”之间有什么区别,因为对我来说它们都应该是同一个远程分支,不是吗?
我怀疑分支相互关联的方式可能存在一些问题,但无法真正弄清楚。奇怪的是,当我删除 branch1 时,我可以轻松部署 branch0 和 branch2。一旦我从 branch0 再次创建 branch1,它又会失败。
Falling back to branch1 branch config
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:16] No branch configuration found for branch branch1, falling back to default configuration
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:16] Begin: Attempting to inherit branch configuration from parent branch
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:16] HEAD is merge commit, this is likely a pull request using master as base
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:17] Begin: Finding branch source of 'master'
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:17] Multiple source branches have been found, picking the first one (develop).
[15:07:52][Step 1/1] This may result in incorrect commit counting.
[15:07:52][Step 1/1] Options were:
[15:07:52][Step 1/1] develop, origin/develop
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:17] End: Finding branch source of 'master' (Took: 1.00ms)
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:17] Begin: Getting branches containing the commit 'hash1'.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:17] Trying to find direct branches.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:17] No direct branches found, searching through tracked branches.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:17] Searching for commits reachable from 'develop'.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:20] The branch 'develop' has a matching commit.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:20] Searching for commits reachable from 'origin/develop'.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:24] The branch 'origin/develop' has a matching commit.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:24] End: Getting branches containing the commit 'hash1'. (Took: 68.00ms)
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:24] Begin: Getting branches containing the commit 'hash2'.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:24] Trying to find direct branches.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:24] No direct branches found, searching through tracked branches.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:24] Searching for commits reachable from 'develop'.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:27] The branch 'develop' has a matching commit.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:27] Searching for commits reachable from 'origin/develop'.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:30] The branch 'origin/develop' has a matching commit.
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:30] End: Getting branches containing the commit 'hash1'. (Took: 66.00ms)
[15:07:52][Step 1/1] INFO [05/25/20 15:07:52:30] Found possible parent branches:
[15:07:52][Step 1/1] WARN [05/25/20 15:07:52:30] Failed to inherit Increment branch configuration, no branches found.```
【问题讨论】:
-
您是否在 TeamCity 中配置了
teamcity.git.fetchAllHeads=true?这是哪个版本的 GitVersion? -
此设置设置为true,它是GitVersion3
-
那么我会推荐升级 GitVersion,因为版本 3 已经很多年了。 GitVersion 当前版本为 5.3.5。
标签: git teamcity gitversion