Reputation: 852
I need to move our relatively large codebase out of TFS and into git and preserve history. Plenty of examples out there for doing this but none cover what happens with branches in tfs that need to become branches in cloned git repo.
If you try these examples your cloned repo will only have a master branch with sub-folders for each TFS branch. This is a serious issue because source code history between branches will be lost.
From what I can see no tool exists that will migrate and reliably preserve history, but please prove me wrong by answering this question.
Edit: This link suggests that there is no support for proper migration
git-tf maps a single TFS folder for example $/project/main to a git repository. We do not mirror/map TFS branches to git branches because branches are fundamentally different in both systems.
Edit 2: git-tfs seems to be a better tool for exporting from TFS, it respects branching but it seems to fail when importing larger TFS codebases where branches have been renamed. There is a pull request of the project which shows progress but still gets caught in some infinite loop when importing.
I hope there is a git command that fixes this issue
Upvotes: 2
Views: 2760
Reputation: 852
I was able to successfully convert my repo by fixing a few minor bugs in git-tfs codebase and a few minor changes to my TFS repo. Details below.
Bottom line: with a little perserverance you can clone TFS repos into git without data loss. https://github.com/git-tfs/git-tfs/pull/480
Upvotes: 2