Teamcity 上的自动合并

Authomatic merging on Teamcity

有问题。任务是:签出 first_branch,将 second_branch 的更改合并到他中,提交并推送这些更改。

仅 Teamcity VCS root 签出 first_branch 没有关于回购中其他分支的任何信息。这就是它找不到 second_branch 而我收到消息 "not something we can merge" 的原因。问题:如何使用 Teamcity 签出同一文件夹中的两个分支?使用 git clone 克隆所有存储库的方法不合适。

如果你想获得单个分支,你可以只添加远程然后获取分支。克隆可能是最简单的,但如果您只想要单个分支,则可以执行以下步骤。

git remote add -t <branch_name> -f origin https://<repo_address>
git checkout <branch_name>