Tuesday 14 May 2013

Migrating distributed branches from Git to Team Foundation Server

If you have to migrate (like me, today) a huge Git repository to Team Foundation Server, it’s very likely that you are going to hit one of the most common walls while migrating a distributed VCS to a centralized one: understanding the branches’ lifecycle.

Briefly, in a DVCS you won’t have the common branches you might find in a VCS like Team Foundation Server, because of the nature of the DVCS itself which tends to have a number of branches for making offline working easier and smoother. Of course you won’t be able to clone this structure inside the Team Foundation Version Control, but there is a way to mitigate it.

I am using Git-Tf, the Microsoft’s tool for migrating Git to Team Foundation Server. After you configured your repository, you should perform a git-tf checkin –deep in order to replicate every single changeset instead of a big bulk one. But you’d get an error:

image

Here is what I meant: if you have multiple parents for a commit, you cannot replicate it inside Team Foundation Server. If you rebase, you are going to edit the history, which is wrong from a preservation point of view.

So you should use the –autosquash switch, which is going to create a linear history without editing it. How? By finding out the HEAD revisions.

No comments:

Post a Comment