Use TFVC and GIT-TFS in one solution simultanouesly

419 views Asked by At

Apology for a very naive question.

Current we are using existing TFVC in our team project and we want to migrate into Git-tfs but something makes me wonder if we can both use TFVC and Git-tfs in one team project and solution simultaneously?

I researched about on how to migrate from TFVC to Git-tfs and I know that TFVC and Git-Tfs can be used in one team project but how about in the same solution? Or this is not possible the end?

1

There are 1 answers

0
jessehouwing On

I'm not entirely sure what you mean by Git-TFS, there are multiple things that might go by this name, so let us clarify that first.

Git is a distributed version control system and since version 2012 Visual Studio has built in support for it. In TFS 2015, 2017 and VSTS you can create Git repositories. These aren't different from repositories hosted by GitHub or any other vendor. But I think these are what you mean by Git-TFS.

Git-tf and Git-TFS are tools that you can install alongside Git on either your client or on your server that allows you to use the Git client for local branches, multiple commits (sort of local undo) and other Git Features while working against a single TFVC repository on a TFS or VSTS server. But I think these are not what you mean by Git-TFS.


Visual Studio can only use a single Version Control client at a time in any given open solution. It will even go so far that it can only be connected to a single repository, be it a TFVC repository or a Git repository a the same time. If you mix and match TFVC and Git in the same solution, Visual Studio will detect the local Git folders and will force itself to the Git Version Control Client.

Trying to mix and match this way will be impossible, Visual Studio will continuously force you to choose either one or the other.

But there are things you can do to move over gradually:

  • Break up the solution into smaller parts and commit each to its own repository. This way you can leave some parts in TFVC while other parts can be stored in Git.
  • Convert some parts of the solution to stand-alone repositories and build NuGet packages from them using the Build server feature in TFS or VSTS. Publish the packages to TFS/VSTS package management and consume these from your solution. Each NuGet package can be stored in its own Git repository and can be maintained separately. When you've removed all packageable parts from the main solution, you can migrate that solution to Git as well.