Home > Blockchain >  Go from TFS to Git
Go from TFS to Git

Time:12-04

I have a client server that has limited rights (no internet or many install priveleges), but it contains a version of TFS. Is there any way possible to get the data and history to bring down to my local computer to put into GIt?

I have tried Git-TFS but cannot get it installed on the server and tried running the source code.

Any ideas besides me downloaded the code for each branch and then adding them in branch by branch and ignoring the previous commits of each branch?

CodePudding user response:

Yes but the server has no Internet and I cannot access it from local.

The client would have to export a zip file per branch HEAD, in order for you to import said branches in a new Git local repository.

That would indeed ignore commits done in each branch, which is standard for "complex" migration (where you keep the old repository for reference)

But you would still need to export back the new repository back to the client, which you can do with git bundle.

CodePudding user response:

Depending on the version of TFS on the server, it could have a built-in option to import the TFVC history into a git repo on the same server. Afterwards you can mirror-clone it to disk and copy it. This will grab a limited history from a single branch though.

Git-TFS doesn't need any special privileges on the server to run, so instead of using the installer try creating a portable version by copying the installed bits from your own workstation.

You'll need a couple of things:

  • A portable version of git.
  • A portable version of tf.exe (you can copy the team explorer folder from a Visual Studio installation)
  • A portable version of Git-TFS.

Open a command prompt, add the paths to the 3 executables to your path variable and run the tool. It should just work.

In extreme cases I'd get a copy of the TFS databases, install a local copy of TFS/Azure DevOps Server on my machine and attach the databases. That way you have full access to the contents in the server to run whatever tools you need to use without having to install anything in the original server.

  • Related