git - 将 'master' 和 'refs/heads/master' 视为 TeamCity 中的同一分支

标签 git github teamcity teamcity-8.0

使用 github 和 teamcity,构建似乎是 refs/heads/mastermaster 分支。

每当 github 服务 Hook 启动构建时,它都在分支 master 上。

每当 TeamCity 启动构建时(例如,当我开始构建时,或依赖构建触发构建时),分支是 refs/heads/master

这会导致在同一页面上显示两个构建编号,master 的最后一个构建和 refs/heads/master 的最后一个构建。

有没有办法让 TeamCity 触发构建构建 master 而不是 refs/heads/master

或者有没有办法让 masterrefs/heads/master 被视为同一个分支,而不是不同的分支?

最佳答案

我想我找到了解决这个问题的方法,尽管它并不理想,因为我必须删除所有通过的构建。

我必须先复制项目并删除旧项目,以摆脱所有已运行的构建。

然后我将默认分支配置为master。我将其他分支规范设置为:

+:(master)
+:refs/heads/(master)

另外,我更新了 VSC 触发器以监听 +:master 而不是 +:*

然后我通过手动触发构建进行测试,并让 github 测试 Hook 触发构建。它似乎有效,它们都在 master 下分组!

关于git - 将 'master' 和 'refs/heads/master' 视为 TeamCity 中的同一分支,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20460577/

相关文章:

git - 尝试将 fork 与上游存储库同步时出现 "You are not currently on a branch"错误

java - 在构建时从 Gradle 设置静态变量

Git Clone,删除 GitHub Repo,创建新的 repo --> 仍有提交历史记录?

github - vendor 文件夹未与 'go build' 一起使用

通过 -File 参数运行时 Powershell 脚本找不到模块

teamcity - 如何在 TeamCity 9.x 中安装 nUnit 3 nunit3-console.exe

git 将子目录推送到另一个主仓库

linux - 如何更改 gitolite 上的存储库位置?

c# - 如何基于Selenium搭建可靠的并行浏览器环境

git - 避免本地提交丢失工作?