As of Azure DevOps Server 2019, migration from Team Foundation Version Control (TFVC) to Git is a simple import command. However, there are caveats to the migration due to how very different Git is in how it stores changes.
Microsoft has a great write-up for this migration and if you have the newer version of Azure DevOps Server or if you're in the cloud, you don't need git-tfs.
But, a few highlights:
- Git is distributed version control, which means that you have a full copy of the files and all historical changes simply by cloning the repository to your machine. You technically don't need a server, but if you have a team and collaborate, a server is needed to share changes with the team via appropriate Git workflows and branching.
- Git is really good at storing text files and will only ever store a single copy of a file with each commit storing a snapshot of the differences in that file over time. Binary files require storage of the full file for each commit that changes the file.
- When binary files need to be stored in a Git repo, it's best to use Git LFS (Large File System). This allows you to mark files as large/binary and Git will only track a reference to the file, not the actual file itself. This keeps the repository small and nimble.
- When you have an enormous repository (files/history) that is in the 2-4 GB range, you may need the Microsoft-contributed Virtual File System for Git, which Microsoft uses for its enormous 500 GB Windows code-base that developers all around the globe work from. Contributions from Microsoft and the rest of the open-source community have done a great job of keeping Git commands performance-tuned for larger repos, but VFS for Git is a big leap for repos that cannot be small.
If you are still running an older version of TFS that doesn't yet have the easy import option, that's OK. Usage of git-tfs is a viable solution and Microsoft also has a great write-up for how to approach this manual migration. In either case, there will potentially be work involved if your code-base if you stored a lot of binary files in TFVC compared to text/code.
What git-tfs is actually doing is creating a historical clone of your TFVC repository into a local Git repository by replaying the history and creating Git commits. The tool can be used as a way to bridge a TFVC repo and Git repo, but you are better off fully migrating to Git and removing the TFVC repository.
Once you decide to fully migrate, it's best to do the migration in a few steps locally in the new cloned Git repo before pushing it to the TFS server as the origin. This allows you to clean up any history of binary files that may be needed. The BFG Repo-Cleaner can be used for this which can re-write history in the Git repo to remove all but the latest change to files like binaries, thus reducing the physical size of the Git repo on disk.