Benjamin Podszun
Benjamin Podszun

Reputation: 9837

Automate git repository creation on TFS 2013

So, there's a sizable Gitorious installation, with hundreds of (mostly small) repositories. Management wants to combine TFS and Git on the same infrastructure, since TFS 2013 supports git repositories. That means we need to migrate hosts/servers.

But .. so far I fail to find a way to create git repositories that doesn't involve me clicking literally hundreds of times on 'Create new repository'. I need some way to automate this process, allowing me to create repositories in an existing team project.

Following this question I can automate team project creation using the tfs power tools - but I cannot find anything related to repositories.

I'm fine with cli tools, powershell, building something in C# - I just fail to find the right keywords or some documentation that might make this possible.

Upvotes: 3

Views: 650

Answers (1)

Giulio Vian
Giulio Vian

Reputation: 8343

I never attempted, but a route could be:

  1. Create the project via tfpt creatteamproject specifying /sourcecontrol:None
  2. Calling the new REST API to create Git repos within the project

Let us know if this works.

UPDATE: I had a chance to test this myself and my solution works also on premise. All details are in my post and is based on the CreateTeamProjectRepository.GitRepositoryService method.

Upvotes: 1

Related Questions