Cloning multiple TFS branches to single Git repo

May 21, 2013 at 11:54 PM
I've just cloned the trunk from a TFS repo to a local GIt repo. I'd like to also clone multiple branches from the TFS repo into the single Git repo so I can checkout branches locally within Git. Is this possible?
Developer
May 22, 2013 at 6:06 PM
Hi Caterman,

I'm sorry to say, but Git-TF does not support that. Branches in TFS are too different from the ones in Git. Also please note that even having a single TFS branch mapped to the master branch in the local Git repository you might need to obey some specific discipline of commits to this branch. If you're going to use --deep check-ins back to the TFS server, you have to maintain a linear history in your master branch, e.g. to use git rebase instead of git merge to move changes to the master branch from other branches.

Thanks,
Alex
Marked as answer by martin on 10/3/2013 at 12:56 PM
Mar 21, 2014 at 4:19 PM
Sorry to mention this but the project is basically useless if you leverage any form of branching in TFS.

There is a github project called git-tfs which properly respects branches and merging history.
I have been able to successfully import a rather large and complicated TFS structure and history into a git repo without data loss. I suggest you look at git-tfs it seems to be a more advanced design.