gittfstfvcgit-tfs

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.


Solution

  • 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