setting up TeamCity to pull multiple git repos with named locations

I am having a problem creating a TeamCity project build that relies on two git repos. In particular, there is content in a primary that relies on a shared repo. This isn’t ideal and needs to change (aka pushing all shared components into nuget), but first things first.

The build machine needs two sibling checkout folders: ‘Project’ and ‘Shared’. Then, from the ‘Project’ folder, I want to kick off a rake task.

Teamcity seems to pull the first ‘Project’ repo, checksout to the /work folder then deletes it and replaces it with a checkout from the ‘Shared’ repo.

Any ideas on how to get this pulling properly?

Thank you,

  • Team City Git “Host key verification failed”
  • TeamCity to GitHub Connection Error: session is down
  • How to clean up TeamCity's remote-run branches from repository?
  • Setting VCS branch via snapshot dependency in TeamCity
  • How to deal with branches and dependencies in TeamCity?
  • How do I get TeamCity to create the .git directory when cloning a repo for build?
  • Teamcity and git repository, connection fails
  • Trigger Snapshot Dependency to Build Specific Branch in TeamCity
  • 2 Solutions collect form web for “setting up TeamCity to pull multiple git repos with named locations”

    I found that I can move the entire tree by setting the VCS Root ‘Checkout rules’ on the repository definition by using the following rule entry:


    This rule says effectively “for the root folder of this repository and everything under it, move it all under a folder called ‘Shared’.

    I then do the same for the ‘Project’ repo, moving it to the ‘Project’ folder and I now have two discrete sibling folders setup under the workspace at build time.

    I did not get much from your question. What I understood is that you have code in 2 repos and you want to pull them into a single folder. In such situation I would either use git submodules or git subtree merge.

    Reference at

    Submodules: Chapter 6.6

    Subtree Merging: Chapter 6.7

    Git Baby is a git and github fan, let's start git clone.