简体   繁体   English

如何在 Visual Studio 中将项目从 Git 移动到 TFS

[英]How to move a project from Git to TFS in Visual Studio

I have a project that I've been working on for some time now and I just cannot make Git work for me.我有一个项目,我已经工作了一段时间,但我无法让 Git 为我工作。 I've spent a day trying to recover lost code and I am done with Git.我花了一天时间试图恢复丢失的代码,我已经完成了 Git。

Can anyone tell me how to move an existing project into TFVC?谁能告诉我如何将现有项目转移到 TFVC 中? I have a Visual Studio Online account with a TFVC project all set up for this task, but I cannot figure out how to change the source control settings so that the project is no longer tied to Git.我有一个 Visual Studio Online 帐户,其中有一个 TFVC 项目,全部为此任务设置,但我不知道如何更改源代码控制设置,以便项目不再与 Git 绑定。

I am currently developing on VS 2013.我目前正在 VS 2013 上进行开发。

Any help is greatly appreciated!任何帮助是极大的赞赏!

Just delete the .git folder (this one is normally hidden) in the root folder (fe via Windows Explorer).只需删除根文件夹中的.git文件夹(这个文件夹通常是隐藏的)(通过 Windows 资源管理器)。 This deletes all things related to git.这将删除与 git 相关的所有内容。 After that add the code to your TFS project and check it in into TFS.之后,将代码添加到您的 TFS 项目并将其签入 TFS。

Here's the procedure.这是程序。

  1. Right click the project name in solution explorer.右键单击解决方案资源管理器中的项目名称。
  2. Open Folder in File Explorer.在文件资源管理器中打开文件夹。
  3. Close Visual Studio.关闭 Visual Studio。
  4. Delete the folder and files that have .git in the name.删除名称中包含 .git 的文件夹和文件。
  5. Open Visual Studio and load the project.打开 Visual Studio 并加载项目。
  6. Tools->Options->Source Control.工具->选项->源代码管理。
  7. Pick TFS.选择 TFS。
  8. Go to Team Explorer tab.转到团队资源管理器选项卡。
  9. Connect to your TFS server (I assume you have already created a repo)连接到您的 TFS 服务器(我假设您已经创建了一个存储库)
  10. Pick the right repo.选择正确的回购。
  11. Right click solution in solution explorer Add to Source Control.在解决方案资源管理器中右键单击解决方案添加到源代码管理。

You cant just change from Git to TFVC as this option is bound to the Team Project.您不能只是从 Git 更改为 TFVC,因为此选项绑定到团队项目。 You will need to create a new Team Project making sure that you select TFVC as the provider.您需要创建一个新的团队项目,确保选择 TFVC 作为提供者。

  1. Connect to that new Team Project and create a local workspace.连接到那个新的团队项目并创建一个本地工作区。
  2. Create the folder structure you need.创建您需要的文件夹结构。 I would recommend $/newTP/MyPeoduct/Rx.x/我会推荐 $/newTP/MyPeoduct/Rx.x/
  3. Copy the files from the Git repo (except .git) to this location.将文件从 Git 存储库(.git 除外)复制到此位置。
  4. Open the solution and right click on it and select "add to source control"打开解决方案并右键单击它并选择“添加到源代码管理”

You should now be migrated...你现在应该被迁移...

VS2017 - I had the same issue listed above and after deleting the .git folder in the root directory of my project folder, clicking Add Project to Source Control only created a new .git, from both Solution Explorer and the File menu. VS2017 - 我遇到了上面列出的相同问题,在删除项目文件夹根目录中的 .git 文件夹后,单击“将项目添加到源代码管理”仅从解决方案资源管理器和文件菜单中创建了一个新的 .git。 I got mine to work by deleting the .git folder, going into Team and Manage Connections and opening the TFS Project I wanted to add it to.我通过删除 .git 文件夹,进入 Team 和 Manage Connections 并打开我想要将其添加到的 TFS 项目来让我的工作。 I then went to File->Source Control->Add Solution to Source Control and it worked.然后我转到文件-> 源代码管理-> 将解决方案添加到源代码管理并且它起作用了。

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

相关问题 如何在 Visual Studio Online 中将项目从 TFS 移动到 Git? - How do I move a Project from TFS to Git in Visual Studio Online? 如何将现有的 Visual Studio 解决方案从 TFVC 项目移动到 Azure DevOps 上的 Git 项目? - How to move an existing Visual Studio solution from TFVC project to Git project on Azure DevOps? 如何在 Visual Studio 中从 TFS visualstudio.com 移动到 GitHub? - How to move from TFS visualstudio.com to GitHub in Visual Studio? 使用Visual Studio 2015 / TFS 2015将项目从Codeplex / TFS传输到SourceForge / Git - Transfert project from Codeplex/TFS to SourceForge/Git with Visual Studio 2015 / TFS 2015 如何在 Visual Studio 中通过 Git 将项目移动到另一个文件夹 - How to move a project to another folder by Git in Visual Studio Visual Studio解决方案与Git项目和TFS项目混合 - Visual studio solution mix with Git project and TFS project 将git项目从一个Visual Studio Online帐户移动到另一个Visual Studio在线帐户 - move a git project from one Visual Studio Online account to a different Visual Studio online account 带有Git版本控制的TFS Online项目如何包含多个Visual Studio解决方案? - How can TFS Online project with Git version control include multiple Visual Studio solutions? Visual Studio 2015和git中的TFS - TFS in visual studio 2015 and git 如何将项目从 TFS 移动到 GitHub? - How to move project from TFS to GitHub?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM