Migrate Git repository to new TFVC repository

大城市里の小女人 提交于 2019-12-10 18:22:15

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/40349494/migrate-git-repository-to-new-tfvc-repository

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!