Hi,
I want to migrate over to Git. Doing a one way migration is possible, but a bridge will be preferable, even for a short time.
I went through all the vast documentation Microsoft released over the past couple of years about migrating to Git.
Overall they highly recommend migrating without history, but my colleagues and I decided we want to try and migrate the history anyway.
I tried using Git-TFS and immediately encountered several issues (that I managed to resolve after some research).
Instead of hitting every wall along the way and hope to survive, I wanted to share my plan with this group and get some feedback.
Basically trying to get your insight on whether migrating with history in my case is even possible.
To start, I will describe our code and TFS structure:
- 4 solutions
- 10 main projects
- Hundreds of branches
- 11 years of history
Each of the 4 solutions uses some of 10 main projects.
So for example:
Solution A is located in team project 1 and uses team projects 2, 3 and 4 (mapping must preserve relative path).
Solution B is located in team project 5 and uses team projects 2, 3 and 6 (mapping must preserve relative path).
Similarly, when I want to branch solution A, I must branch all of it's projects.
Since many teams worked on the different solutions over the years, there is no single branch for solution A. There are many.
A solution A branch will look like that:
$/some-random-path/some_random_name/Project1
$/some-random-path/some_random_name/Project2
$/some-random-path/some_random_name/Project3
$/some-random-path/some_random_name/Project4
When I used Git-TFS, I noticed that every time a project was branched into a folder in another team project, the history of that entire team project was pulled.
Even if there were only a couple of changes to that project in that branch.
So when I looked at the history of a specific file it looked fine, but the history of the newly migrated repo was a mess.
Question number 1 - is there a way to avoid this?
During the migration, I encountered some issues that caused the Git-TFS clone to stop.
Usually it involved team projects that were deleted and recreated later on or check-ins that had files from multiple team projects and one of them was deleted.
I managed to resume the clone with another get command, specifying the next changeset number after the one that stopped it.
Question number 2 - Is it the right way to solve this? If so, is there an option to automate this?
Out team projects are packed with large files and we must use LFS to properly handle them.
I noticed a few open issues with using LFS, but they describe problems with the Git -> TFS bridge, not the migration itself.
So I assume that if we'll do a one way migration, we will be able to store our large files in LFS.
Question number 3 - Did anyone actually tried that? When during the process should we specify the LFS attributes?
When we're finally in Git world, working on a single solution that is using code from multiple repositories is annoying.
At first we thought we can merge some of the projects, but projects that are shared between solution had to be separate (and mapped using submodules or something like that).
But after trying that for a short while, we decided the better way to go is to have a single repository with all 10 projects and 4 solutions.
Since Git-TFS clones team projects into repositories, we will have to merge those repositories (with history) after the migration.
The plan:
- Clone each of the 10 projects with full history, branches, etc.
- Use LFS configuration somehow.
- Manually fix clone issues (like changesets on deleted team projects)
- If #2 failed, try Git BFG to apply LFS configuration retroactively.
- Merge the repositories.
Do you think this is doable? What pitfalls should I be aware of?
I am at attempt #3 to migrate to Git and I don't know how much longer I can invest in this.
Any tip you can give will go a long way.
Thanks in advance,
Nati.