Convert Git repo to team project on VSTS

Viewed 355

Is it possible with Visual Studio Team Services using Git to convert a repository under a team project to its own project with full history? So, here's the as-is structure in the VSTS:

  • MyTeamProject1
    • MyRepo1
    • MyRepo2
  • MyTeamProject2

Here's the desired structure:

  • MyTeamProject1
  • MyRepo1 (could be renamed to a Team Project)
  • MyRepo2
  • MyTeamProject2

In other words MyRepo1 and MyRepo2 Git repositories are now team projects in VSTS and their history is preserved.

I've seen this solution but it's talking about creating a collection, not a team project, and not sure if it keeps the commit history during the migration: Convert Git Repo to TFS team collection

During the migration, I don't want to move away from Git to TFVC; wish to continue using Git.

1 Answers

A Team Project is a container for things like work items, source code repositories, build definitions, etc.

Thus, what you want to do is:

  1. Create a new team project
  2. Add an empty repository to it
  3. Add a remote to your existing repository (on your workstation)
  4. Push that repo to the empty repo created in step #2.

However, it's worth noting that general guidance is to keep everything within a single team project.

Related