4

My team and I have a large TFS Project with many Visual Studio solutions and many Projects. We are in the process of splitting up this Project into smaller logical parts, and moving the parts into separate git repositories. I have started to look at git-tf so that we can keep the history of the files. What I need to do is to pick say 3-4 folders from a flat structure in the tfs-project and copy them into a single git repository. By use of git-tf clone or git-tf configure/pull, I seem to get one repo per parent folder in the tfs project. Is there a way to get around this, or do i rearrange the tfs-project so that the folders I want are moved into a common parent folder?

  • Are you using TFS 2013? TFS 2013 has native support for Git, there's no need to use git-tf. – Daniel Mann Oct 14 '14 at 23:53
  • I know, and I will still maintain my code using Visual studio, once the move to git has been done. But I want to keep the change history when I move my code to a git repository. – Jan Petter Jetmundsen Oct 15 '14 at 06:14
  • This has nothing to do with Visual Studio. In TFS 2013, you can create a team project that's backed by Git version control instead of Team Foundation Version Control. You can use the TFS git repository exactly the same way you would use any other git repository, including pushing an existing repository into it, preserving all of the change history. – Daniel Mann Oct 15 '14 at 16:19
  • Maybe I overcomplicate things, or maybe I've explained my problem badly. I've managed to clone a part of the tfs project into a new git repository, or pull it into an existing. But this is a one to one relationship between the tfs project folder and the git repository. In my large tfs Project, i have fifty projects where i want to move four of them into one git repository. If i clone the parent folder, I get all the fifty Projects. If i clone the folders one by one, I get four git repositories. I can move the four projects I want into a New parent folder, but I was hoping to avoid this. – Jan Petter Jetmundsen Oct 16 '14 at 08:43

1 Answers1

5

There is no way to selectively pull from TFVC into Git and you must pick a parent branch for scoping.

However, once you have the folders in git there is a Split command that will let you split the repo into multiple parts. This does let you choose folders.

http://lostechies.com/johnteague/2014/04/04/using-git-subtrees-to-split-a-repository/