Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Migrate Git repository to new TFVC repository

How do you use git-tfs to mirror/copy an existing Git repository to a NEW TFS 2010 TFVC repository? The existing Git repository was NOT cloned from TFS.

I need to move the source code from our master branch in our remote/local Git repository into a new TFVC repository for posterity sake, and to update it on every release to production.

I've tried to use git-tfs to accomplish this but it appears that it needs to START with a Git repository that was originally cloned from TFS, which is not possible. I might consider using git-tf instead, but the company I work for is a Microsoft shop and I would prefer using a solution that is more Microsoft oriented and not use a solution that requires Java for political reasons.

like image 376
Bryan Ambrogiano Avatar asked Oct 31 '16 19:10

Bryan Ambrogiano


People also ask

What is the difference between Git and TFVC?

Git is the default version control provider for new projects. You should use Git for version control in your projects and begin to move your existing TFVC projects to Git. TFVC is considered feature complete. Azure DevOps will maintain compatibility with TFVC, but Git will receive all future investment.


1 Answers

You can migrate all history of main branch from local repo to a new TFVC team project with following steps:

  1. Create an empty TFVC team project
  2. Go to your local Repo folder, and use git-tf checkin --deep command to checkin the local repo to a TFVC team project. By default, the checkin command will create a single TFS changeset for the aggregate of all changes made on the current branch in Git since the last checkin to TFS. When used with the --deep option, a TFS changeset will be created for each Git commit on the current branch since the last checkin to TFS.

enter image description here

like image 190
Cece Dong - MSFT Avatar answered Oct 17 '22 14:10

Cece Dong - MSFT