Migrate Git repository to new TFVC repository
Asked Answered
A

1

6

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.

Aldaaldan answered 31/10, 2016 at 19:48 Comment(4)
It looks to me like git-tf is your best option for the moment, or you can use this as a case to upgrade to TFS 2013+ for its Git supportArdene
The organization is planning to move to TFS 2015 to use Git. But the machine moves slowly so we are forced to put our Git repository in TFS 2010 for now. I'm using git-tf now and it's almost working. I can't get --keep-author to work on the checkin --deep since I receive a 500 internal server error when it calls the TFS ReadIdentities web service API method. That's another issue!Aldaaldan
git-tfs is not the way to go. And your company will be pleased because git-tf is a (no more maintained) Microsoft project. But is still the way to go....Diminished
Thanks for the clarification. I've decided to use git-tf and other than the --keep-author error, it's working as expected. I will continue to use it as our standard practice when we finish a release and need to update the TFVC repository.Aldaaldan
L
5

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

Lissner answered 1/11, 2016 at 2:52 Comment(2)
Thanks Cece - MSFT. That's what I did and it worked as expected.Aldaaldan
@BryanAmbrogiano May I know how clone/migrate your remote Git Repo into remote TFVC repo? Mind to share the step?Karren

© 2022 - 2024 — McMap. All rights reserved.