简体   繁体   English

在TFS 2013中将TFS项目转换为Git协议

[英]Convert TFS Project to Git protocol in TFS 2013

Microsoft Team Foundation Server (TFS) 2013, supports Git protocol. Microsoft Team Foundation Server(TFS)2013支持Git协议。 When you create TFS project, you choose should it be as Git or TFS (legacy) for source-control. 创建TFS项目时,您可以选择将其作为源代码控制的Git或TFS(旧版)。 I have all projects in TFS mode, and I would like to connect my Visual Studio 2013 to existing TFS projects using new - git protocol so I will have additional features. 我有所有TFS模式的项目,我想使用new-git协议将我的Visual Studio 2013连接到现有的TFS项目,所以我将有其他功能。 How can I achieve this for existing projects ? 如何为现有项目实现这一目标? (for new ones its clear, just choose option while creating TFS Project) (对于新的,明确的,只需在创建TFS项目时选择选项)

There is misunderstanding here. 这里有误解。 TFVC and Git are two different models in TFS: it is not simply the protocol on the wire; TFVC和Git是TFS中的两种不同模型:它不仅仅是线路上的协议; the way data is stored and manipulated, both on the client and the server, are different. 在客户端和服务器上存储和操作数据的方式是不同的。 You may create new projects, but not converting existing one, nor let the two models coexist in the same project in TFS 2013. In case you want to migrate you may use Git-tf to move sources, but you need to move also the other data: work items, builds, tests. 您可以创建项目,但不能转换现有项目,也不要让这两个模型在TFS 2013中的同一项目中共存。如果您想要迁移,您可以使用Git-tf移动源,但您还需要移动另一个数据:工作项目,构建,测试。

The first question you have to ask yourself is: do I need this? 你要问自己的第一个问题是:我需要这个吗? See Which version control system should I use: TFVC or Git? 请参阅我应该使用哪个版本控制系统:TFVC或Git? for a start and consider migration costs in the picture. 首先考虑图片中的迁移成本。

UPDATE : TFS 2015 Update 1 and later allow coexistence of the two models in the same project (see the Release Notes ). 更新 :TFS 2015 Update 1及更高版本允许在同一项目中共存两个模型(请参阅发行说明 )。 All the other considerations (why and how migrate) still apply. 所有其他考虑因素(为什么以及如何迁移)仍然适用。

You can migrate from TFVC to GIT. 您可以从TFVC迁移到GIT。

You need to: 你需要:

  • Create a new git repo on TFS 在TFS上创建一个新的git仓库
  • Clone down the TFVC repo with git-tfs (this will convert, with history, into a local git repo) 使用git-tfs克隆TFVC仓库(这将使用历史记录转换为本地git仓库)
  • Clean up any tfs artifacts 清理任何tfs工件
  • Add git ignore etc 添加git ignore等
  • Set the git remote to the new tfs git powered repo 将git remote设置为新的tfs git powered repo
  • Push up 俯卧撑
  • Happiness 幸福

There is a write up on the MSDN blog here: http://blogs.msdn.com/b/tfssetup/archive/2015/05/19/migrating-a-tfvc-team-project-to-a-git-team-project-along-with-changeset-history-in-tfs.aspx MSDN博客上有一篇文章: http//blogs.msdn.com/b/tfssetup/archive/2015/05/19/migrating-a-tfvc-team-project-to-a-git-team -项目-沿与-变更历史功能于tfs.aspx

Or just look at the tfs-git docs: https://github.com/git-tfs/git-tfs 或者只看一下tfs-git文档: https//github.com/git-tfs/git-tfs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM