简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM